From 946f5fb98376935453fbc2db24f224d154187554 Mon Sep 17 00:00:00 2001 From: Dombi Attila <83396+dombesz@users.noreply.github.com> Date: Fri, 22 Nov 2024 14:27:47 +0200 Subject: [PATCH] Merge migrations --- ... 20241030154245_create_project_life_cycles.rb} | 15 ++++++++++++++- ...41105151352_create_project_life_cycle_steps.rb | 14 -------------- ...41105175000_add_life_cycle_to_work_packages.rb | 5 ----- 3 files changed, 14 insertions(+), 20 deletions(-) rename db/migrate/{20241030154245_create_project_life_cycle_step_definitions.rb => 20241030154245_create_project_life_cycles.rb} (75%) delete mode 100644 db/migrate/20241105151352_create_project_life_cycle_steps.rb delete mode 100644 db/migrate/20241105175000_add_life_cycle_to_work_packages.rb diff --git a/db/migrate/20241030154245_create_project_life_cycle_step_definitions.rb b/db/migrate/20241030154245_create_project_life_cycles.rb similarity index 75% rename from db/migrate/20241030154245_create_project_life_cycle_step_definitions.rb rename to db/migrate/20241030154245_create_project_life_cycles.rb index 9be47cfe79cb..e3c28014eb1a 100644 --- a/db/migrate/20241030154245_create_project_life_cycle_step_definitions.rb +++ b/db/migrate/20241030154245_create_project_life_cycles.rb @@ -26,7 +26,7 @@ # See COPYRIGHT and LICENSE files for more details. #++ -class CreateProjectLifeCycleStepDefinitions < ActiveRecord::Migration[7.1] +class CreateProjectLifeCycles < ActiveRecord::Migration[7.1] def change create_table :project_life_cycle_step_definitions do |t| t.string :type @@ -36,5 +36,18 @@ def change t.timestamps end + + create_table :project_life_cycle_steps do |t| + t.string :type + t.date :start_date + t.date :end_date + t.boolean :active, default: false, null: false + t.references :project, foreign_key: true + t.references :definition, foreign_key: { to_table: :project_life_cycle_step_definitions } + + t.timestamps + end + + add_reference :work_packages, :project_life_cycle_step, null: true end end diff --git a/db/migrate/20241105151352_create_project_life_cycle_steps.rb b/db/migrate/20241105151352_create_project_life_cycle_steps.rb deleted file mode 100644 index cb4f7553b279..000000000000 --- a/db/migrate/20241105151352_create_project_life_cycle_steps.rb +++ /dev/null @@ -1,14 +0,0 @@ -class CreateProjectLifeCycleSteps < ActiveRecord::Migration[7.1] - def change - create_table :project_life_cycle_steps do |t| - t.string :type - t.date :start_date - t.date :end_date - t.boolean :active, default: false, null: false - t.references :project, foreign_key: true - t.references :definition, foreign_key: { to_table: :project_life_cycle_step_definitions } - - t.timestamps - end - end -end diff --git a/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb b/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb deleted file mode 100644 index 423eb83cac79..000000000000 --- a/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb +++ /dev/null @@ -1,5 +0,0 @@ -class AddLifeCycleToWorkPackages < ActiveRecord::Migration[7.1] - def change - add_reference :work_packages, :project_life_cycle_step, null: true - end -end