2018-11-13 02:27:31 -05:00
|
|
|
class AddProjectIdToSubscriptions < ActiveRecord::Migration[4.2]
|
2016-10-31 13:40:27 -04:00
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def up
|
|
|
|
add_column :subscriptions, :project_id, :integer
|
2017-02-09 10:52:43 -05:00
|
|
|
add_foreign_key :subscriptions, :projects, column: :project_id, on_delete: :cascade # rubocop: disable Migration/AddConcurrentForeignKey
|
2016-10-31 13:40:27 -04:00
|
|
|
end
|
|
|
|
|
|
|
|
def down
|
2017-03-13 08:36:17 -04:00
|
|
|
remove_foreign_key :subscriptions, column: :project_id
|
2016-10-31 13:40:27 -04:00
|
|
|
remove_column :subscriptions, :project_id
|
|
|
|
end
|
|
|
|
end
|