debian-mirror-gitlab/db/migrate/20170127032550_remove_backlog_lists_from_boards.rb
2017-08-17 22:00:37 +05:30

18 lines
346 B
Ruby

class RemoveBacklogListsFromBoards < ActiveRecord::Migration
DOWNTIME = false
def up
execute <<-SQL
DELETE FROM lists WHERE list_type = 0;
SQL
end
def down
execute <<-SQL
INSERT INTO lists (board_id, list_type, created_at, updated_at)
SELECT boards.id, 0, NOW(), NOW()
FROM boards;
SQL
end
end