gitlab-org--gitlab-foss/db/migrate/20180305095250_create_internal_ids_table.rb
2018-03-16 13:35:27 +01:00

15 lines
413 B
Ruby

class CreateInternalIdsTable < ActiveRecord::Migration
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