2019-01-01 20:40:33 -05:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class CreateReleasesLinkTable < ActiveRecord::Migration[5.0]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def change
|
2019-01-03 23:34:20 -05:00
|
|
|
create_table :release_links, id: :bigserial do |t|
|
2019-01-01 20:40:33 -05:00
|
|
|
t.references :release, null: false, index: false, foreign_key: { on_delete: :cascade }
|
|
|
|
t.string :url, null: false
|
|
|
|
t.string :name, null: false
|
|
|
|
t.timestamps_with_timezone null: false
|
|
|
|
|
2019-01-02 05:56:03 -05:00
|
|
|
t.index [:release_id, :url], unique: true
|
2019-01-01 20:40:33 -05:00
|
|
|
t.index [:release_id, :name], unique: true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|