Websites/db/migrate/20240102073042_create_api_usages.rb
2024-05-02 22:04:43 -05:00

18 lines
538 B
Ruby

# frozen_string_literal: true
class CreateAPIUsages < ActiveRecord::Migration[7.1]
def change
create_table(:api_usages) do |t|
t.references(:user, foreign_key: { to_table: :api_users })
t.references(:api_key)
t.text(:user_agent, null: false, default: "")
t.text(:method, null: false, default: "GET")
t.text(:path, null: false, default: "/")
t.jsonb(:params, null: false, default: "{}")
t.text(:service, null: false)
t.inet(:ip_addr, null: false)
t.timestamps
end
end
end