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
Ruby agile-developmentangularbcfboardsbug-trackerganttgantt-chartifcissue-trackerjira-alternativekanbanopenprojectproduct-managementproject-managementproject-planningroadmaprubyscrumtimelineworkflows
Make projects identifier non nullable
Christophe Bliard3dc6effdb044
diff --git a/db/migrate/20221130150352_create_project_journals.rb b/db/migrate/20221130150352_create_project_journals.rbindex 216466982b8..c70c7767109 100644--- a/db/migrate/20221130150352_create_project_journals.rb+++ b/db/migrate/20221130150352_create_project_journals.rb@@ -6,7 +6,7 @@ class CreateProjectJournals < ActiveRecord::Migration[7.0]t.text :descriptiont.boolean :public, null: falset.bigint :parent_id- t.string :identifier+ t.string :identifier, null: falset.boolean :active, null: falset.boolean :templated, null: falseenddiff --git a/db/migrate/20221201140825_add_non_null_constraint_on_projects_identifier.rb b/db/migrate/20221201140825_add_non_null_constraint_on_projects_identifier.rbnew file mode 100644index 00000000000..b351bb2c0d0--- /dev/null+++ b/db/migrate/20221201140825_add_non_null_constraint_on_projects_identifier.rb@@ -0,0 +1,16 @@+class AddNonNullConstraintOnProjectsIdentifier < ActiveRecord::Migration[7.0]+ def change+ reversible do |dir|+ dir.up do+ # should not be needed as all identifiers should be present+ execute <<~SQL.squish+ UPDATE projects+ SET identifier = 'project-' || id+ WHERE identifier IS NULL+ SQL+ end+ end++ change_column_null :projects, :identifier, false+ end+end