2018-03-01 02:12:32 +00:00
|
|
|
class CreateCiBuildsMetadataTable < ActiveRecord::Migration
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
|
|
|
DOWNTIME = false
|
|
|
|
|
|
|
|
def change
|
2018-03-05 16:35:06 +00:00
|
|
|
create_table :ci_builds_metadata, id: false 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.primary_key :build_id
|
|
|
|
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
|
|
|
|
|
|
|
|
t.index :project_id
|
2018-03-01 02:12:32 +00:00
|
|
|
end
|
|
|
|
end
|
|
|
|
end
|