From 732b122644bf56729996b3cc239453f537a798f4 Mon Sep 17 00:00:00 2001 From: Michael Kozono Date: Fri, 6 Oct 2017 16:33:49 -0700 Subject: Add throttle application settings --- db/schema.rb | 9 +++++++++ 1 file changed, 9 insertions(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 37e08d453c8..7f16a6c5c22 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -140,6 +140,15 @@ ActiveRecord::Schema.define(version: 20171106180641) do t.integer "circuitbreaker_storage_timeout", default: 30 t.integer "circuitbreaker_access_retries", default: 3 t.integer "circuitbreaker_backoff_threshold", default: 80 + t.boolean "throttle_unauthenticated_enabled", default: false, null: false + t.integer "throttle_unauthenticated_requests_per_period", default: 3600, null: false + t.integer "throttle_unauthenticated_period_in_seconds", default: 3600, null: false + t.boolean "throttle_authenticated_api_enabled", default: false, null: false + t.integer "throttle_authenticated_api_requests_per_period", default: 7200, null: false + t.integer "throttle_authenticated_api_period_in_seconds", default: 3600, null: false + t.boolean "throttle_authenticated_web_enabled", default: false, null: false + t.integer "throttle_authenticated_web_requests_per_period", default: 7200, null: false + t.integer "throttle_authenticated_web_period_in_seconds", default: 3600, null: false end create_table "audit_events", force: :cascade do |t| -- cgit v1.2.1 From 8f84369ae105c59a0c5cd947edb352fd616c4335 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Tue, 14 Nov 2017 12:39:26 +0100 Subject: Delete orphaned fork networks in a migration --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 37e08d453c8..53299792a39 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171106180641) do +ActiveRecord::Schema.define(version: 20171114104051) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" -- cgit v1.2.1 From 936e9e895000c9f9ae39713c969b325f6b59c0c3 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 14 Nov 2017 16:58:56 +0100 Subject: Clean up schema of the "merge_requests" table This adds various foreign keys and indexes to the "merge_requests" table as outlined in https://gitlab.com/gitlab-org/gitlab-ce/issues/31825. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/31825 --- db/schema.rb | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 25b4fa8b888..7afab18df08 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171114104051) do +ActiveRecord::Schema.define(version: 20171114162227) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1040,7 +1040,7 @@ ActiveRecord::Schema.define(version: 20171114104051) do create_table "merge_requests", force: :cascade do |t| t.string "target_branch", null: false t.string "source_branch", null: false - t.integer "source_project_id", null: false + t.integer "source_project_id" t.integer "author_id" t.integer "assignee_id" t.string "title" @@ -1080,6 +1080,7 @@ ActiveRecord::Schema.define(version: 20171114104051) do add_index "merge_requests", ["description"], name: "index_merge_requests_on_description_trigram", using: :gin, opclasses: {"description"=>"gin_trgm_ops"} add_index "merge_requests", ["head_pipeline_id"], name: "index_merge_requests_on_head_pipeline_id", using: :btree add_index "merge_requests", ["latest_merge_request_diff_id"], name: "index_merge_requests_on_latest_merge_request_diff_id", using: :btree + add_index "merge_requests", ["merge_user_id"], name: "index_merge_requests_on_merge_user_id", where: "(merge_user_id IS NOT NULL)", using: :btree add_index "merge_requests", ["milestone_id"], name: "index_merge_requests_on_milestone_id", using: :btree add_index "merge_requests", ["source_branch"], name: "index_merge_requests_on_source_branch", using: :btree add_index "merge_requests", ["source_project_id", "source_branch"], name: "index_merge_requests_on_source_project_id_and_source_branch", using: :btree @@ -1088,6 +1089,7 @@ ActiveRecord::Schema.define(version: 20171114104051) do add_index "merge_requests", ["target_project_id", "merge_commit_sha", "id"], name: "index_merge_requests_on_tp_id_and_merge_commit_sha_and_id", using: :btree add_index "merge_requests", ["title"], name: "index_merge_requests_on_title", using: :btree add_index "merge_requests", ["title"], name: "index_merge_requests_on_title_trigram", using: :gin, opclasses: {"title"=>"gin_trgm_ops"} + add_index "merge_requests", ["updated_by_id"], name: "index_merge_requests_on_updated_by_id", where: "(updated_by_id IS NOT NULL)", using: :btree create_table "merge_requests_closing_issues", force: :cascade do |t| t.integer "merge_request_id", null: false @@ -1965,7 +1967,13 @@ ActiveRecord::Schema.define(version: 20171114104051) do add_foreign_key "merge_request_metrics", "merge_requests", on_delete: :cascade add_foreign_key "merge_requests", "ci_pipelines", column: "head_pipeline_id", name: "fk_fd82eae0b9", on_delete: :nullify add_foreign_key "merge_requests", "merge_request_diffs", column: "latest_merge_request_diff_id", name: "fk_06067f5644", on_delete: :nullify + add_foreign_key "merge_requests", "milestones", name: "fk_6a5165a692", on_delete: :nullify + add_foreign_key "merge_requests", "projects", column: "source_project_id", name: "fk_3308fe130c", on_delete: :nullify add_foreign_key "merge_requests", "projects", column: "target_project_id", name: "fk_a6963e8447", on_delete: :cascade + add_foreign_key "merge_requests", "users", column: "assignee_id", name: "fk_6149611a04", on_delete: :nullify + add_foreign_key "merge_requests", "users", column: "author_id", name: "fk_e719a85f8a", on_delete: :nullify + add_foreign_key "merge_requests", "users", column: "merge_user_id", name: "fk_ad525e1f87", on_delete: :nullify + add_foreign_key "merge_requests", "users", column: "updated_by_id", name: "fk_641731faff", on_delete: :nullify add_foreign_key "merge_requests_closing_issues", "issues", on_delete: :cascade add_foreign_key "merge_requests_closing_issues", "merge_requests", on_delete: :cascade add_foreign_key "milestones", "namespaces", column: "group_id", name: "fk_95650a40d4", on_delete: :cascade -- cgit v1.2.1 From aafe5c123ef2f64ddf44a5655a6fc63ec4e571da Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Tue, 21 Nov 2017 15:57:02 +0100 Subject: Update composite pipelines index to include "id" This updates the composite index on ci_pipelines (project_id, ref, status) to also include the "id" column at the end. Adding this column to the index drastically improves the performance of queries used for getting the latest pipeline for a particular branch. For example, on project dashboards we'll run a query like the following: SELECT ci_pipelines.* FROM ci_pipelines WHERE ci_pipelines.project_id = 13083 AND ci_pipelines.ref = 'master' AND ci_pipelines.status = 'success' ORDER BY ci_pipelines.id DESC LIMIT 1; Limit (cost=0.43..58.88 rows=1 width=224) (actual time=26.956..26.956 rows=1 loops=1) Buffers: shared hit=6544 dirtied=16 -> Index Scan Backward using ci_pipelines_pkey on ci_pipelines (cost=0.43..830922.89 rows=14216 width=224) (actual time=26.954..26.954 rows=1 loops=1) Filter: ((project_id = 13083) AND ((ref)::text = 'master'::text) AND ((status)::text = 'success'::text)) Rows Removed by Filter: 6476 Buffers: shared hit=6544 dirtied=16 Planning time: 1.484 ms Execution time: 27.000 ms Because of the lack of "id" in the index we end up scanning over the primary key index, then applying a filter to filter out any remaining rows. The more pipelines a GitLab instance has the slower this will get. By adding "id" to the mentioned composite index we can change the above plan into the following: Limit (cost=0.56..2.01 rows=1 width=224) (actual time=0.034..0.034 rows=1 loops=1) Buffers: shared hit=5 -> Index Scan Backward using yorick_test on ci_pipelines (cost=0.56..16326.37 rows=11243 width=224) (actual time=0.033..0.033 rows=1 loops=1) Index Cond: ((project_id = 13083) AND ((ref)::text = 'master'::text) AND ((status)::text = 'success'::text)) Buffers: shared hit=5 Planning time: 0.695 ms Execution time: 0.061 ms This in turn leads to a best-case improvement of roughly 25 milliseconds, give or take a millisecond or two. --- db/schema.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 7afab18df08..a82270390f1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171114162227) do +ActiveRecord::Schema.define(version: 20171121144800) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -382,7 +382,7 @@ ActiveRecord::Schema.define(version: 20171114162227) do add_index "ci_pipelines", ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree add_index "ci_pipelines", ["pipeline_schedule_id"], name: "index_ci_pipelines_on_pipeline_schedule_id", using: :btree - add_index "ci_pipelines", ["project_id", "ref", "status"], name: "index_ci_pipelines_on_project_id_and_ref_and_status", using: :btree + add_index "ci_pipelines", ["project_id", "ref", "status", "id"], name: "index_ci_pipelines_on_project_id_and_ref_and_status_and_id", using: :btree add_index "ci_pipelines", ["project_id", "sha"], name: "index_ci_pipelines_on_project_id_and_sha", using: :btree add_index "ci_pipelines", ["project_id"], name: "index_ci_pipelines_on_project_id", using: :btree add_index "ci_pipelines", ["status"], name: "index_ci_pipelines_on_status", using: :btree -- cgit v1.2.1 From 98bb78a4bd61ebd9b1e3c812d6ddf8fedb993573 Mon Sep 17 00:00:00 2001 From: Shinya Maeda Date: Thu, 16 Nov 2017 18:41:19 +0900 Subject: Add environment_scope to cluster table --- db/schema.rb | 1 + 1 file changed, 1 insertion(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index a82270390f1..bca8b96b2c1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -523,6 +523,7 @@ ActiveRecord::Schema.define(version: 20171121144800) do t.datetime_with_timezone "updated_at", null: false t.boolean "enabled", default: true t.string "name", null: false + t.string "environment_scope", default: "*", null: false end add_index "clusters", ["enabled"], name: "index_clusters_on_enabled", using: :btree -- cgit v1.2.1 From 257fd5713485a05460a9170190100643199a7e48 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Thu, 23 Nov 2017 13:16:14 +0000 Subject: Allow password authentication to be disabled entirely --- db/schema.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index bca8b96b2c1..d10561099b7 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -129,7 +129,6 @@ ActiveRecord::Schema.define(version: 20171121144800) do t.boolean "prometheus_metrics_enabled", default: false, null: false t.boolean "help_page_hide_commercial_content", default: false t.string "help_page_support_url" - t.boolean "password_authentication_enabled" t.integer "performance_bar_allowed_group_id" t.boolean "hashed_storage_enabled", default: false, null: false t.boolean "project_export_enabled", default: true, null: false @@ -149,6 +148,8 @@ ActiveRecord::Schema.define(version: 20171121144800) do t.boolean "throttle_authenticated_web_enabled", default: false, null: false t.integer "throttle_authenticated_web_requests_per_period", default: 7200, null: false t.integer "throttle_authenticated_web_period_in_seconds", default: 3600, null: false + t.boolean "password_authentication_enabled_for_web" + t.boolean "password_authentication_enabled_for_git", default: true end create_table "audit_events", force: :cascade do |t| -- cgit v1.2.1 From 4beacdb2ca6ea884473cb63aee603951df7f2da1 Mon Sep 17 00:00:00 2001 From: Yorick Peterse Date: Fri, 24 Nov 2017 14:27:38 +0100 Subject: Fix defaults for MR states and merge statuses This ensures that merge_requests.state and merge_requests.merge_status both have a proper default value and NOT NULL constraint on database level. We also make sure to update any bogus rows first, without blowing up the database. Fixes https://gitlab.com/gitlab-org/gitlab-ce/issues/40534 --- db/schema.rb | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index d10561099b7..804bc8d6e37 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171121144800) do +ActiveRecord::Schema.define(version: 20171124132536) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -1049,8 +1049,8 @@ ActiveRecord::Schema.define(version: 20171121144800) do t.datetime "created_at" t.datetime "updated_at" t.integer "milestone_id" - t.string "state" - t.string "merge_status" + t.string "state", default: "opened", null: false + t.string "merge_status", default: "unchecked", null: false t.integer "target_project_id", null: false t.integer "iid" t.text "description" -- cgit v1.2.1 From 4ebbfe5d3e0dbe06346ee0c64a8f62ec11f9b6e8 Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Tue, 21 Nov 2017 16:58:08 +0000 Subject: Remove serialised diff and commit columns The st_commits and st_diffs columns on merge_request_diffs historically held the YAML-serialised data for a merge request diff, in a variety of formats. Since 9.5, these have been migrated in the background to two new tables: merge_request_diff_commits and merge_request_diff_files. That has the advantage that we can actually query the data (for instance, to find out how many commits we've stored), and that it can't be in a variety of formats, but must match the new schema. This is the final step of that journey, where we drop those columns and remove all references to them. This is a breaking change to the importer, because we can no longer import diffs created in the old format, and we cannot guarantee the export will be in the new format unless it was generated after this commit. --- db/schema.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 804bc8d6e37..292163ee9bf 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1011,8 +1011,6 @@ ActiveRecord::Schema.define(version: 20171124132536) do create_table "merge_request_diffs", force: :cascade do |t| t.string "state" - t.text "st_commits" - t.text "st_diffs" t.integer "merge_request_id", null: false t.datetime "created_at" t.datetime "updated_at" -- cgit v1.2.1 From 484ae2ee2db58a641d3c3fff36f46b431ce450df Mon Sep 17 00:00:00 2001 From: Sean McGivern Date: Fri, 24 Nov 2017 10:11:37 +0000 Subject: Improve indexes on merge_request_diffs For getting the SHAs from an MR to find pipelines, we get the last 100 MR diffs for the MR, and find commits from those. This was un-indexed before, because the index was not a composite index on merge_request_diff_id, id. Changing that means that this scope can exclusively use indexes. --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 292163ee9bf..339c98d7798 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -1020,7 +1020,7 @@ ActiveRecord::Schema.define(version: 20171124132536) do t.string "start_commit_sha" end - add_index "merge_request_diffs", ["merge_request_id"], name: "index_merge_request_diffs_on_merge_request_id", using: :btree + add_index "merge_request_diffs", ["merge_request_id", "id"], name: "index_merge_request_diffs_on_merge_request_id_and_id", using: :btree create_table "merge_request_metrics", force: :cascade do |t| t.integer "merge_request_id", null: false -- cgit v1.2.1 From 64e5f996fa01d2e9c8462cfbb647997531eaf6c7 Mon Sep 17 00:00:00 2001 From: Andrew Newdigate Date: Wed, 29 Nov 2017 09:12:12 +0000 Subject: Add timeouts for Gitaly calls --- db/schema.rb | 3 +++ 1 file changed, 3 insertions(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 804bc8d6e37..1e524621b4f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -150,6 +150,9 @@ ActiveRecord::Schema.define(version: 20171124132536) do t.integer "throttle_authenticated_web_period_in_seconds", default: 3600, null: false t.boolean "password_authentication_enabled_for_web" t.boolean "password_authentication_enabled_for_git", default: true + t.integer "gitaly_timeout_default", default: 55, null: false + t.integer "gitaly_timeout_medium", default: 30, null: false + t.integer "gitaly_timeout_fast", default: 10, null: false end create_table "audit_events", force: :cascade do |t| -- cgit v1.2.1 From e03d4a2096f2d32dbb51d427ae99dfb6d49e6a00 Mon Sep 17 00:00:00 2001 From: Bob Van Landuyt Date: Fri, 24 Nov 2017 15:52:15 +0100 Subject: Reschedule the migration to populate fork networks Rescheduling will make sure the fork networks with a deleted source project are created. --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 1e524621b4f..69307f2ca2b 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171124132536) do +ActiveRecord::Schema.define(version: 20171124150326) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" -- cgit v1.2.1 From 8ac7f29726989bc0a20ee32780aa18625159f8b4 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Mon, 18 Sep 2017 15:33:24 +0200 Subject: Create ci_artifacts table --- db/schema.rb | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index effb2604af2..b37e0eabbd6 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -226,6 +226,20 @@ ActiveRecord::Schema.define(version: 20171124150326) do add_index "chat_teams", ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree + create_table "ci_artifacts", force: :cascade do |t| + t.integer "project_id", null: false + t.integer "ci_build_id", null: false + t.integer "size", limit: 8, default: 0 + t.datetime "created_at", null: false + t.datetime "updated_at", null: false + t.datetime "expire_at" + t.integer "erased_by_id", null: false + t.datetime "erased_at" + t.text "file" + end + + add_index "ci_artifacts", ["project_id", "ci_build_id"], name: "index_ci_artifacts_on_project_id_and_ci_build_id", unique: true, using: :btree + create_table "ci_build_trace_section_names", force: :cascade do |t| t.integer "project_id", null: false t.string "name", null: false @@ -1901,6 +1915,8 @@ ActiveRecord::Schema.define(version: 20171124150326) do add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade add_foreign_key "chat_teams", "namespaces", on_delete: :cascade + add_foreign_key "ci_artifacts", "ci_builds", on_delete: :cascade + add_foreign_key "ci_artifacts", "projects", on_delete: :cascade add_foreign_key "ci_build_trace_section_names", "projects", on_delete: :cascade add_foreign_key "ci_build_trace_sections", "ci_build_trace_section_names", column: "section_name_id", name: "fk_264e112c66", on_delete: :cascade add_foreign_key "ci_build_trace_sections", "ci_builds", column: "build_id", name: "fk_4ebe41f502", on_delete: :cascade -- cgit v1.2.1 From 25df666156279e5b392b429519b4f4ba01eefaac Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Tue, 19 Sep 2017 09:14:06 +0200 Subject: Create Ci::Artifacts To allow jobs/builds to have multiple artifacts, and to start seperating concerns from Ci::Build a new model is created: Ci::Artifact. Changes include the updating of the ArtifactUploader to adapt to a slightly different interface. The uploader expects to be initialized with a `Ci::Build`. Futher a migration with the minimal fields, the needed foreign keys and an index. Last, the way this works is by prepending a module to Ci::Build so we can basically override behaviour but if needed use `super` to get the original behaviour. --- db/schema.rb | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index b37e0eabbd6..b4048371676 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -229,12 +229,10 @@ ActiveRecord::Schema.define(version: 20171124150326) do create_table "ci_artifacts", force: :cascade do |t| t.integer "project_id", null: false t.integer "ci_build_id", null: false + t.integer "type", default: 0, null: false t.integer "size", limit: 8, default: 0 - t.datetime "created_at", null: false - t.datetime "updated_at", null: false - t.datetime "expire_at" - t.integer "erased_by_id", null: false - t.datetime "erased_at" + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false t.text "file" end -- cgit v1.2.1 From 61864a5a5bb523953589c9398a431c4369fbfc76 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 21 Sep 2017 10:34:12 +0200 Subject: Rename Artifact to JobArtifact, split metadata out Two things at ones, as there was no clean way to seperate the commit and give me feedback from the tests. But the model Artifact is now JobArtifact, and the table does not have a type anymore, but the metadata is now its own model: Ci::JobArtifactMetadata. --- db/schema.rb | 31 ++++++++++++++++--------------- 1 file changed, 16 insertions(+), 15 deletions(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index b4048371676..46a3b147198 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -226,18 +226,6 @@ ActiveRecord::Schema.define(version: 20171124150326) do add_index "chat_teams", ["namespace_id"], name: "index_chat_teams_on_namespace_id", unique: true, using: :btree - create_table "ci_artifacts", force: :cascade do |t| - t.integer "project_id", null: false - t.integer "ci_build_id", null: false - t.integer "type", default: 0, null: false - t.integer "size", limit: 8, default: 0 - t.datetime_with_timezone "created_at", null: false - t.datetime_with_timezone "updated_at", null: false - t.text "file" - end - - add_index "ci_artifacts", ["project_id", "ci_build_id"], name: "index_ci_artifacts_on_project_id_and_ci_build_id", unique: true, using: :btree - create_table "ci_build_trace_section_names", force: :cascade do |t| t.integer "project_id", null: false t.string "name", null: false @@ -331,6 +319,20 @@ ActiveRecord::Schema.define(version: 20171124150326) do add_index "ci_group_variables", ["group_id", "key"], name: "index_ci_group_variables_on_group_id_and_key", unique: true, using: :btree + create_table "ci_job_artifacts", force: :cascade do |t| + t.integer "project_id", null: false + t.integer "ci_job_id", null: false + t.integer "size", limit: 8 + t.integer "file_type", null: false + t.datetime_with_timezone "created_at", null: false + t.datetime_with_timezone "updated_at", null: false + 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", ["project_id"], name: "index_ci_job_artifacts_on_project_id", using: :btree + create_table "ci_pipeline_schedule_variables", force: :cascade do |t| t.string "key", null: false t.text "value" @@ -391,9 +393,9 @@ ActiveRecord::Schema.define(version: 20171124150326) do t.integer "auto_canceled_by_id" t.integer "pipeline_schedule_id" t.integer "source" - t.integer "config_source" t.boolean "protected" t.integer "failure_reason" + t.integer "config_source" end add_index "ci_pipelines", ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree @@ -1913,8 +1915,6 @@ ActiveRecord::Schema.define(version: 20171124150326) do add_foreign_key "boards", "projects", name: "fk_f15266b5f9", on_delete: :cascade add_foreign_key "chat_teams", "namespaces", on_delete: :cascade - add_foreign_key "ci_artifacts", "ci_builds", on_delete: :cascade - add_foreign_key "ci_artifacts", "projects", on_delete: :cascade add_foreign_key "ci_build_trace_section_names", "projects", on_delete: :cascade add_foreign_key "ci_build_trace_sections", "ci_build_trace_section_names", column: "section_name_id", name: "fk_264e112c66", on_delete: :cascade add_foreign_key "ci_build_trace_sections", "ci_builds", column: "build_id", name: "fk_4ebe41f502", on_delete: :cascade @@ -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", "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 add_foreign_key "ci_pipeline_schedules", "users", column: "owner_id", name: "fk_9ea99f58d2", on_delete: :nullify -- cgit v1.2.1 From c7d945758accc6f80ee63c7c3b25782cf7f6f3b0 Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 2 Nov 2017 19:38:25 +0100 Subject: Fix most test failures --- db/schema.rb | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'db/schema.rb') 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 -- cgit v1.2.1 From 592e0877f470efbb224043a6f887265afa070e0b Mon Sep 17 00:00:00 2001 From: Zeger-Jan van de Weg Date: Thu, 30 Nov 2017 16:05:17 +0100 Subject: Add unique index on job_id and file_type --- db/schema.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 0f71463acd8..3ec183f1c05 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171124150326) do +ActiveRecord::Schema.define(version: 20171130145523) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" @@ -330,6 +330,7 @@ ActiveRecord::Schema.define(version: 20171124150326) do end add_index "ci_job_artifacts", ["file_type"], name: "index_ci_job_artifacts_on_file_type", using: :btree + add_index "ci_job_artifacts", ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true, 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 -- cgit v1.2.1 From 0464c25f602dc2e4d147ca2ac714d49bf96ddcf2 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Sun, 3 Dec 2017 12:02:11 +0100 Subject: Store expire_at in ci_job_artifacts --- db/schema.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 3ec183f1c05..64f67574b3f 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -322,10 +322,11 @@ ActiveRecord::Schema.define(version: 20171130145523) do create_table "ci_job_artifacts", force: :cascade do |t| t.integer "project_id", null: false t.integer "job_id", null: false - t.integer "size", limit: 8 t.integer "file_type", null: false + t.integer "size", limit: 8 t.datetime_with_timezone "created_at", null: false t.datetime_with_timezone "updated_at", null: false + t.datetime_with_timezone "expire_at" t.string "file" end -- cgit v1.2.1 From b8a393192529015bc2fa9d04c2782cf96e7ec896 Mon Sep 17 00:00:00 2001 From: Markus Koller Date: Wed, 22 Nov 2017 14:48:38 +0100 Subject: Add custom brand text on new project pages --- db/schema.rb | 2 ++ 1 file changed, 2 insertions(+) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index effb2604af2..ad4c7f690d1 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -36,6 +36,8 @@ ActiveRecord::Schema.define(version: 20171124150326) do t.datetime_with_timezone "updated_at", null: false t.text "description_html" t.integer "cached_markdown_version" + t.text "new_project_guidelines" + t.text "new_project_guidelines_html" end create_table "application_settings", force: :cascade do |t| -- cgit v1.2.1 From e58ce2b72eec6b92986884ee80b974b83134b7f4 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Mon, 4 Dec 2017 19:23:44 +0100 Subject: Remove index on file_type --- db/schema.rb | 2 -- 1 file changed, 2 deletions(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index 64f67574b3f..de84d861530 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -330,9 +330,7 @@ ActiveRecord::Schema.define(version: 20171130145523) do t.string "file" end - add_index "ci_job_artifacts", ["file_type"], name: "index_ci_job_artifacts_on_file_type", using: :btree add_index "ci_job_artifacts", ["job_id", "file_type"], name: "index_ci_job_artifacts_on_job_id_and_file_type", unique: true, 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| -- cgit v1.2.1 From 92e8ad5247e2e2c8b6488327c9818e2d83f3a881 Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 5 Dec 2017 12:03:35 +0100 Subject: Merge index during table creation --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index de84d861530..da3894c2076 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -11,7 +11,7 @@ # # It's strongly recommended that you check this file into your version control system. -ActiveRecord::Schema.define(version: 20171130145523) do +ActiveRecord::Schema.define(version: 20171124150326) do # These are extensions that must be enabled in order to support this database enable_extension "plpgsql" -- cgit v1.2.1 From 9711b34491d5cfd6eb2bf379f43dbbcd629a572c Mon Sep 17 00:00:00 2001 From: Kamil Trzcinski Date: Tue, 5 Dec 2017 12:06:34 +0100 Subject: Move config_source earlier --- db/schema.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'db/schema.rb') diff --git a/db/schema.rb b/db/schema.rb index da3894c2076..8e5bcc8b51d 100644 --- a/db/schema.rb +++ b/db/schema.rb @@ -393,9 +393,9 @@ ActiveRecord::Schema.define(version: 20171124150326) do t.integer "auto_canceled_by_id" t.integer "pipeline_schedule_id" t.integer "source" + t.integer "config_source" t.boolean "protected" t.integer "failure_reason" - t.integer "config_source" end add_index "ci_pipelines", ["auto_canceled_by_id"], name: "index_ci_pipelines_on_auto_canceled_by_id", using: :btree -- cgit v1.2.1