diff options
author | Zeger-Jan van de Weg <git@zjvandeweg.nl> | 2017-11-02 21:38:25 +0300 |
---|---|---|
committer | Kamil Trzcinski <ayufan@ayufan.eu> | 2017-12-03 14:04:49 +0300 |
commit | c7d945758accc6f80ee63c7c3b25782cf7f6f3b0 (patch) | |
tree | 4d3f5dd8325eee87ab72a3c0269f452a0edacd82 /db | |
parent | cc750539ec852e9f42ea25b31cc14a45962fc975 (diff) |
Fix most test failures
Diffstat (limited to 'db')
-rw-r--r-- | db/migrate/20170918072948_create_job_artifacts.rb | 4 | ||||
-rw-r--r-- | db/schema.rb | 5 |
2 files changed, 6 insertions, 3 deletions
diff --git a/db/migrate/20170918072948_create_job_artifacts.rb b/db/migrate/20170918072948_create_job_artifacts.rb index 6d1756f368c..078e3e9dc4e 100644 --- a/db/migrate/20170918072948_create_job_artifacts.rb +++ b/db/migrate/20170918072948_create_job_artifacts.rb @@ -6,7 +6,7 @@ class CreateJobArtifacts < ActiveRecord::Migration def change create_table :ci_job_artifacts do |t| t.belongs_to :project, null: false, index: true, foreign_key: { on_delete: :cascade } - t.integer :ci_job_id, null: false, index: true + t.integer :job_id, null: false, index: true t.integer :size, limit: 8 t.integer :file_type, null: false, index: true @@ -15,5 +15,7 @@ class CreateJobArtifacts < ActiveRecord::Migration t.string :file end + + add_foreign_key :ci_job_artifacts, :ci_builds, column: :job_id, on_delete: :cascade end end diff --git a/db/schema.rb b/db/schema.rb index 46a3b147198..0f71463acd8 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -321,7 +321,7 @@ ActiveRecord::Schema.define(version: 20171124150326) do create_table "ci_job_artifacts", force: :cascade do |t| t.integer "project_id", null: false - t.integer "ci_job_id", null: false + t.integer "job_id", null: false t.integer "size", limit: 8 t.integer "file_type", null: false t.datetime_with_timezone "created_at", null: false @@ -329,8 +329,8 @@ ActiveRecord::Schema.define(version: 20171124150326) do t.string "file" end - add_index "ci_job_artifacts", ["ci_job_id"], name: "index_ci_job_artifacts_on_ci_job_id", using: :btree add_index "ci_job_artifacts", ["file_type"], name: "index_ci_job_artifacts_on_file_type", using: :btree + add_index "ci_job_artifacts", ["job_id"], name: "index_ci_job_artifacts_on_job_id", using: :btree add_index "ci_job_artifacts", ["project_id"], name: "index_ci_job_artifacts_on_project_id", using: :btree create_table "ci_pipeline_schedule_variables", force: :cascade do |t| @@ -1923,6 +1923,7 @@ ActiveRecord::Schema.define(version: 20171124150326) 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_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 add_foreign_key "ci_pipeline_schedule_variables", "ci_pipeline_schedules", column: "pipeline_schedule_id", name: "fk_41c35fda51", on_delete: :cascade add_foreign_key "ci_pipeline_schedules", "projects", name: "fk_8ead60fcc4", on_delete: :cascade |