debian-mirror-gitlab/db/migrate/20190722144316_create_milestone_releases_table.rb
2020-06-23 00:09:42 +05:30

22 lines
681 B
Ruby

# frozen_string_literal: true
class CreateMilestoneReleasesTable < ActiveRecord::Migration[5.2]
include Gitlab::Database::MigrationHelpers
DOWNTIME = false
def up
create_table :milestone_releases do |t|
t.references :milestone, foreign_key: { on_delete: :cascade }, null: false, index: false
t.references :release, foreign_key: { on_delete: :cascade }, null: false
end
add_index :milestone_releases, [:milestone_id, :release_id], unique: true, name: 'index_miletone_releases_on_milestone_and_release'
end
def down
# rubocop:disable Migration/DropTable
drop_table :milestone_releases
# rubocop:enable Migration/DropTable
end
end