OpenProject is the leading open source project management software.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
 
 
 
 
 
 
openproject/db/migrate/20220909153412_drop_week_da...

21 lines
459 B

class DropWeekDays < ActiveRecord::Migration[7.0]
def up
drop_table :week_days
end
def down
create_table :week_days do |t|
t.integer :day, null: false
t.boolean :working, null: false, default: true
t.timestamps
end
execute <<-SQL.squish
ALTER TABLE week_days
ADD CONSTRAINT unique_day_number UNIQUE (day);
ALTER TABLE week_days
ADD CHECK (day >= 1 AND day <=7);
SQL
end
end