Websites/db/migrate/20241021191225_create_external_api_images.rb

15 lines
490 B
Ruby
Raw Normal View History

# frozen_string_literal: true
class CreateExternalAPIImages < ActiveRecord::Migration[7.1]
def change
create_table(:external_api_images) do |t|
t.references(:api_image, foreign_key: true, null: false, type: :uuid)
t.string(:site, null: false)
t.jsonb(:cached_data, null: false, default: {})
t.integer(:external_id, null: false)
t.datetime(:cache_last_updated_at, null: false, default: -> { "CURRENT_TIMESTAMP(3)" })
t.timestamps
end
end
end