diff --git a/db/migrate/20230127095856_rename_caf_id_to_objective_id.rb b/db/migrate/20230127095856_rename_caf_id_to_objective_id.rb index 1a88907..dfea2a6 100644 --- a/db/migrate/20230127095856_rename_caf_id_to_objective_id.rb +++ b/db/migrate/20230127095856_rename_caf_id_to_objective_id.rb @@ -1,5 +1,5 @@ class RenameCafIdToObjectiveId < ActiveRecord::Migration[7.0] - def change_table + def change remove_foreign_key :principles, :cafs remove_index :principles, :caf_id rename_column :principles, :caf_id, :objective_id diff --git a/db/schema.rb b/db/schema.rb index 4e7efd3..2dce6f0 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -81,13 +81,13 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_27_095856) do end create_table "principles", charset: "utf8mb4", force: :cascade do |t| - t.bigint "caf_id", null: false + t.bigint "objective_id", null: false t.string "name" t.text "description" t.datetime "created_at", null: false t.datetime "updated_at", null: false - t.index ["caf_id"], name: "index_principles_on_caf_id" t.index ["name"], name: "index_principles_on_name" + t.index ["objective_id"], name: "fk_rails_7b57179db6" end create_table "subprincipleitemgroups", charset: "utf8mb4", force: :cascade do |t| @@ -143,7 +143,7 @@ ActiveRecord::Schema[7.0].define(version: 2023_01_27_095856) do add_foreign_key "active_storage_variant_records", "active_storage_blobs", column: "blob_id" add_foreign_key "cafs", "companies" add_foreign_key "objectives", "cafs" - add_foreign_key "principles", "cafs" + add_foreign_key "principles", "objectives" add_foreign_key "subprincipleitemgroups", "subprinciples" add_foreign_key "subprincipleitems", "subprincipleitemgroups" add_foreign_key "subprinciples", "principles"