debian-mirror-gitlab/lib/tasks/migrate/composite_primary_keys.rake

18 lines
614 B
Ruby
Raw Normal View History

2021-03-11 19:13:27 +05:30
# frozen_string_literal: true
2018-11-08 19:23:39 +05:30
namespace :gitlab do
namespace :db do
2020-03-13 15:44:24 +05:30
desc 'GitLab | DB | Adds primary keys to tables that only have composite unique keys'
2018-11-08 19:23:39 +05:30
task composite_primary_keys_add: :environment do
require Rails.root.join('db/optional_migrations/composite_primary_keys')
CompositePrimaryKeysMigration.new.up
end
2020-03-13 15:44:24 +05:30
desc 'GitLab | DB | Removes previously added composite primary keys'
2018-11-08 19:23:39 +05:30
task composite_primary_keys_drop: :environment do
require Rails.root.join('db/optional_migrations/composite_primary_keys')
CompositePrimaryKeysMigration.new.down
end
end
end