1
0
Fork 0
mirror of https://github.com/mastodon/mastodon.git synced 2024-08-20 21:08:15 -07:00
mastodon/db/migrate/20240111033014_create_generated_annual_reports.rb
2024-01-24 09:38:10 +00:00

17 lines
509 B
Ruby

# frozen_string_literal: true
class CreateGeneratedAnnualReports < ActiveRecord::Migration[7.1]
def change
create_table :generated_annual_reports do |t|
t.belongs_to :account, null: false, foreign_key: { on_cascade: :delete }, index: false
t.integer :year, null: false
t.jsonb :data, null: false
t.integer :schema_version, null: false
t.datetime :viewed_at
t.timestamps
end
add_index :generated_annual_reports, [:account_id, :year], unique: true
end
end