diff options
author | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-26 18:58:35 +0200 |
---|---|---|
committer | Tomasz Maczukin <tomasz@maczukin.pl> | 2018-03-28 14:00:04 +0200 |
commit | 403decbbad26bea620125aed34b440a9b6611172 (patch) | |
tree | 1c587d73c314873a113d27f4c271866770d6a57e /db/migrate/20180301010859_create_ci_builds_metadata_table.rb | |
parent | 7008ed1e33bff510126a0eb0e4f7bf1a7adb02bd (diff) | |
download | gitlab-ce-403decbbad26bea620125aed34b440a9b6611172.tar.gz |
Add explicit primary key for ci_builds_metadata table
Diffstat (limited to 'db/migrate/20180301010859_create_ci_builds_metadata_table.rb')
-rw-r--r-- | db/migrate/20180301010859_create_ci_builds_metadata_table.rb | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/db/migrate/20180301010859_create_ci_builds_metadata_table.rb b/db/migrate/20180301010859_create_ci_builds_metadata_table.rb index 650bf43835d..ce737444092 100644 --- a/db/migrate/20180301010859_create_ci_builds_metadata_table.rb +++ b/db/migrate/20180301010859_create_ci_builds_metadata_table.rb @@ -4,16 +4,16 @@ class CreateCiBuildsMetadataTable < ActiveRecord::Migration DOWNTIME = false def change - create_table :ci_builds_metadata, id: false do |t| + create_table :ci_builds_metadata do |t| t.integer :build_id, null: false t.integer :project_id, null: false t.integer :timeout t.integer :timeout_source, null: false, default: 1 - t.primary_key :build_id t.foreign_key :ci_builds, column: :build_id, on_delete: :cascade t.foreign_key :projects, column: :project_id, on_delete: :cascade + t.index :build_id, unique: true t.index :project_id end end |