Browse Source

Add migration for organisation name changes

pull/3053/head
Manny Dinssa 3 weeks ago
parent
commit
f51a7e822a
  1. 15
      db/migrate/20250409113321_create_organisation_name_changes.rb
  2. 12
      db/schema.rb

15
db/migrate/20250409113321_create_organisation_name_changes.rb

@ -0,0 +1,15 @@
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.string :change_type
t.datetime :change_date, null: false
t.datetime :discarded_at
t.timestamps
end
add_index :organisation_name_changes, %i[organisation_id change_date], unique: true, name: "index_org_name_changes_on_org_id_and_change_date"
end
end

12
db/schema.rb

@ -497,6 +497,18 @@ ActiveRecord::Schema[7.2].define(version: 2025_03_05_092900) do
t.boolean "show_additional_page"
end
create_table "organisation_name_changes", force: :cascade do |t|
t.bigint "organisation_id", null: false
t.string "name", null: false
t.string "change_type"
t.datetime "change_date", null: false
t.datetime "discarded_at"
t.datetime "created_at", null: false
t.datetime "updated_at", null: false
t.index ["organisation_id", "change_date"], name: "index_org_name_changes_on_org_id_and_change_date", unique: true
t.index ["organisation_id"], name: "index_organisation_name_changes_on_organisation_id"
end
create_table "organisation_relationships", force: :cascade do |t|
t.integer "child_organisation_id"
t.integer "parent_organisation_id"

Loading…
Cancel
Save