2018-02-28 21:12:32 -05:00
|
|
|
class CreateCiBuildsMetadataTable < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def change
|
2018-03-26 12:58:35 -04:00
|
|
|
create_table :ci_builds_metadata do |t|
|
2018-02-28 21:12:32 -05:00
|
|
|
t.integer :build_id, null: false
|
2018-03-20 20:20:15 -04:00
|
|
|
t.integer :project_id, null: false
|
2018-03-06 10:25:13 -05:00
|
|
|
t.integer :timeout
|
2018-03-05 11:35:06 -05:00
|
|
|
t.integer :timeout_source, null: false, default: 1
|
|
|
|
|
|
|
|
t.foreign_key :ci_builds, column: :build_id, on_delete: :cascade
|
2018-03-20 20:20:15 -04:00
|
|
|
t.foreign_key :projects, column: :project_id, on_delete: :cascade
|
|
|
|
|
2018-03-26 12:58:35 -04:00
|
|
|
t.index :build_id, unique: true
|
2018-03-20 20:20:15 -04:00
|
|
|
t.index :project_id
|
2018-02-28 21:12:32 -05:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|