Welcome to mirror list, hosted at ThFree Co, Russian Federation.

20180305095250_create_internal_ids_table.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 8565f5d848b339269914a6405c0cff85867d44c1 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
class CreateInternalIdsTable < ActiveRecord::Migration[4.2]
  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