Websites/db/migrate/20231114130956_create_api_images.rb
2024-05-02 22:04:43 -05:00

22 lines
714 B
Ruby

# frozen_string_literal: true
class CreateAPIImages < ActiveRecord::Migration[7.1]
def change
create_table(:api_images, id: :uuid) do |t|
t.references(:creator, foreign_key: { to_table: :api_users }, null: false)
t.inet(:creator_ip_addr, null: false)
t.string(:artists, array: true, default: [])
t.string(:sources, array: true, default: [])
t.integer(:width, null: false)
t.integer(:height, null: false)
t.string(:mime_type, null: false)
t.string(:category, null: false)
t.string(:created_by, null: false)
t.string(:original_url)
t.string(:file_ext, null: false)
t.integer(:file_size, null: false)
t.timestamps
end
end
end