2019-02-15 15:39:39 +05:30
|
|
|
class CreateInternalIdsTable < ActiveRecord::Migration[4.2]
|
2018-05-09 12:01:36 +05:30
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def change
|
|
|
|
create_table :internal_ids, id: :bigserial do |t|
|
|
|
|
t.references :project, null: false, foreign_key: { on_delete: :cascade }
|
|
|
|
t.integer :usage, null: false
|
|
|
|
t.integer :last_value, null: false
|
|
|
|
|
|
|
|
t.index [:usage, :project_id], unique: true
|
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|