2 changed files with 28 additions and 1 deletions
@ -0,0 +1,15 @@
|
||||
class CreateOrganisationNameChanges < ActiveRecord::Migration[7.0] |
||||
def change |
||||
create_table :organisation_name_changes do |t| |
||||
t.references :organisation, null: false, foreign_key: true |
||||
t.string :name, null: false |
||||
t.date :startdate, null: false |
||||
t.date :discarded_at |
||||
t.integer :change_type |
||||
|
||||
t.timestamps |
||||
end |
||||
|
||||
add_index :organisation_name_changes, %i[organisation_id startdate], unique: true, name: "index_org_name_changes_on_org_id_and_startdate" |
||||
end |
||||
end |
Loading…
Reference in new issue