Skip to content

OpenProject is the leading open source project management software for product, project and portfolio management. A powerful Jira alternative with agile planning, issue tracking, roadmaps, Gantt charts, time tracking, collaboration features, and more. Available on premises or in the cloud. ⭐ Star us on GitHub

Squash migrations

Dombi Attilac7f7c70d22ba
diff --git a/db/migrate/20241030154245_create_life_cycles.rb b/db/migrate/20241030154245_create_life_cycles.rb
index 557c7ec8a6f..343eea91a4c 100644
--- a/db/migrate/20241030154245_create_life_cycles.rb
+++ b/db/migrate/20241030154245_create_life_cycles.rb
@@ -31,7 +31,7 @@ class CreateLifeCycles < ActiveRecord::Migration[7.1]
create_table :life_cycles do |t|
t.string :type
t.string :name
- t.belongs_to :color, type: :int
+ t.references :color, foreign_key: true
t.timestamps
end
diff --git a/db/migrate/20241105151352_create_project_life_cycles.rb b/db/migrate/20241105151352_create_project_life_cycles.rb
index 3aab5365def..847be712c1d 100644
--- a/db/migrate/20241105151352_create_project_life_cycles.rb
+++ b/db/migrate/20241105151352_create_project_life_cycles.rb
@@ -4,6 +4,7 @@ class CreateProjectLifeCycles < ActiveRecord::Migration[7.1]
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 :life_cycle, foreign_key: true
diff --git a/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb b/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb
index 13aaf9d8ab4..3d24434d617 100644
--- a/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb
+++ b/db/migrate/20241105175000_add_life_cycle_to_work_packages.rb
@@ -1,8 +1,5 @@
class AddLifeCycleToWorkPackages < ActiveRecord::Migration[7.1]
def change
- add_reference :work_packages,
- :project_life_cycle,
- foreign_key: { to_table: :project_life_cycles },
- null: true
+ add_reference :work_packages, :project_life_cycle, foreign_key: true, null: true
end
end
diff --git a/db/migrate/20241114130242_add_active_flag_to_project_life_cycles.rb b/db/migrate/20241114130242_add_active_flag_to_project_life_cycles.rb
deleted file mode 100644
index 5e0bd687af5..00000000000
--- a/db/migrate/20241114130242_add_active_flag_to_project_life_cycles.rb
+++ /dev/null
@@ -1,5 +0,0 @@
-class AddActiveFlagToProjectLifeCycles < ActiveRecord::Migration[7.1]
- def change
- add_column :project_life_cycles, :active, :boolean, default: false, null: false
- end
-end