remove default code for existing projects

As copied projects are to receive a `gray`/not set state, I assume that the same is to be true for new projects and hence also for every project where no user has made an explicit statement
pull/7722/head
ulferts 5 years ago
parent a5621578e2
commit 6d3b3a8bb2
No known key found for this signature in database
GPG Key ID: A205708DE1284017
  1. 15
      db/migrate/20190923111902_add_project_status_reporting.rb

@ -6,20 +6,5 @@ class AddProjectStatusReporting < ActiveRecord::Migration[6.0]
table.integer :code table.integer :code
table.timestamps table.timestamps
end end
reversible do |change|
change.up do
project_status_for_existing_projects
end
end
end
def project_status_for_existing_projects
insert_sql = <<-SQL
INSERT into project_statuses
SELECT id AS project_id, #{Project::Status.codes['on_track']} as code FROM projects
SQL
insert Arel.sql(insert_sql)
end end
end end

Loading…
Cancel
Save