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