Browse Source

Drop organisation_name_changes table if it exists

pull/3053/head
Manny Dinssa 3 months ago
parent
commit
a4cb5bbac0
  1. 15
      db/migrate/20250409113321_create_organisation_name_changes.rb
  2. 5
      db/migrate/20250416101343_drop_organisation_name_changes_table.rb

15
db/migrate/20250409113321_create_organisation_name_changes.rb

@ -1,15 +0,0 @@
class CreateOrganisationNameChanges < ActiveRecord::Migration[7.2]
def change
create_table :organisation_name_changes do |t|
t.references :organisation, null: false, foreign_key: true
t.string :name, null: false
t.integer :change_type
t.date :startdate, null: false
t.datetime :discarded_at
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

5
db/migrate/20250416101343_drop_organisation_name_changes_table.rb

@ -0,0 +1,5 @@
class DropOrganisationNameChangesTable < ActiveRecord::Migration[7.2]
def change
drop_table :organisation_name_changes, if_exists: true
end
end
Loading…
Cancel
Save