summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorTomasz Maczukin <tomasz@maczukin.pl>2018-03-21 01:20:15 +0100
committerTomasz Maczukin <tomasz@maczukin.pl>2018-03-28 13:58:34 +0200
commita1cd3390e550c0008e83146e8627fdee3f58e422 (patch)
tree348413849dac37229d4ec9d59834440844481e3c /db
parentafcc57abfdcb11001803655f938187cbdc96b67c (diff)
downloadgitlab-ce-a1cd3390e550c0008e83146e8627fdee3f58e422.tar.gz
Add project_id column to Ci::BuildMetadata
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20180301010859_create_ci_builds_metadata_table.rb4
-rw-r--r--db/schema.rb4
2 files changed, 8 insertions, 0 deletions
diff --git a/db/migrate/20180301010859_create_ci_builds_metadata_table.rb b/db/migrate/20180301010859_create_ci_builds_metadata_table.rb
index 72c204026d8..650bf43835d 100644
--- a/db/migrate/20180301010859_create_ci_builds_metadata_table.rb
+++ b/db/migrate/20180301010859_create_ci_builds_metadata_table.rb
@@ -6,11 +6,15 @@ class CreateCiBuildsMetadataTable < ActiveRecord::Migration
def change
create_table :ci_builds_metadata, id: false 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 :project_id
end
end
end
diff --git a/db/schema.rb b/db/schema.rb
index a14823dfa15..56541aa4ecd 100644
--- a/db/schema.rb
+++ b/db/schema.rb
@@ -330,10 +330,13 @@ ActiveRecord::Schema.define(version: 20180327101207) do
add_index "ci_builds", ["user_id"], name: "index_ci_builds_on_user_id", using: :btree
create_table "ci_builds_metadata", primary_key: "build_id", force: :cascade do |t|
+ t.integer "project_id", null: false
t.integer "timeout"
t.integer "timeout_source", default: 1, null: false
end
+ add_index "ci_builds_metadata", ["project_id"], name: "index_ci_builds_metadata_on_project_id", using: :btree
+
create_table "ci_group_variables", force: :cascade do |t|
t.string "key", null: false
t.text "value"
@@ -2035,6 +2038,7 @@ ActiveRecord::Schema.define(version: 20180327101207) do
add_foreign_key "ci_builds", "ci_stages", column: "stage_id", name: "fk_3a9eaa254d", on_delete: :cascade
add_foreign_key "ci_builds", "projects", name: "fk_befce0568a", on_delete: :cascade
add_foreign_key "ci_builds_metadata", "ci_builds", column: "build_id", on_delete: :cascade
+ add_foreign_key "ci_builds_metadata", "projects", on_delete: :cascade
add_foreign_key "ci_group_variables", "namespaces", column: "group_id", name: "fk_33ae4d58d8", on_delete: :cascade
add_foreign_key "ci_job_artifacts", "ci_builds", column: "job_id", on_delete: :cascade
add_foreign_key "ci_job_artifacts", "projects", on_delete: :cascade