Welcome to mirror list, hosted at ThFree Co, Russian Federation.

gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
path: root/db
diff options
context:
space:
mode:
authorGitLab Bot <gitlab-bot@gitlab.com>2021-02-11 06:09:06 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-02-11 06:09:06 +0300
commit17e74fcd4654243a4e4f2c1cfbb0d00508a0050e (patch)
tree8cca162268ff4f36384b128d1a0ae4b72dd9c752 /db
parentced6c9ae9a9a80c884cafbea9c717b578dfac326 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/migrate/20210204212850_add_group_id_to_ci_daily_build_group_report_results.rb9
-rw-r--r--db/migrate/20210208144134_add_index_group_id_to_ci_daily_build_group_report_results.rb20
-rw-r--r--db/schema_migrations/202102042128501
-rw-r--r--db/schema_migrations/202102081441341
-rw-r--r--db/structure.sql8
5 files changed, 38 insertions, 1 deletions
diff --git a/db/migrate/20210204212850_add_group_id_to_ci_daily_build_group_report_results.rb b/db/migrate/20210204212850_add_group_id_to_ci_daily_build_group_report_results.rb
new file mode 100644
index 00000000000..ba0464f5ad6
--- /dev/null
+++ b/db/migrate/20210204212850_add_group_id_to_ci_daily_build_group_report_results.rb
@@ -0,0 +1,9 @@
+# frozen_string_literal: true
+
+class AddGroupIdToCiDailyBuildGroupReportResults < ActiveRecord::Migration[6.0]
+ DOWNTIME = false
+
+ def change
+ add_column(:ci_daily_build_group_report_results, :group_id, :bigint)
+ end
+end
diff --git a/db/migrate/20210208144134_add_index_group_id_to_ci_daily_build_group_report_results.rb b/db/migrate/20210208144134_add_index_group_id_to_ci_daily_build_group_report_results.rb
new file mode 100644
index 00000000000..422d8174043
--- /dev/null
+++ b/db/migrate/20210208144134_add_index_group_id_to_ci_daily_build_group_report_results.rb
@@ -0,0 +1,20 @@
+# frozen_string_literal: true
+
+class AddIndexGroupIdToCiDailyBuildGroupReportResults < ActiveRecord::Migration[6.0]
+ include Gitlab::Database::MigrationHelpers
+
+ DOWNTIME = false
+ INDEX_NAME = 'index_ci_daily_build_group_report_results_on_group_id'
+
+ disable_ddl_transaction!
+
+ def up
+ add_concurrent_index(:ci_daily_build_group_report_results, :group_id, name: INDEX_NAME)
+ add_concurrent_foreign_key(:ci_daily_build_group_report_results, :namespaces, column: :group_id)
+ end
+
+ def down
+ remove_foreign_key_if_exists(:ci_daily_build_group_report_results, column: :group_id)
+ remove_concurrent_index_by_name(:ci_daily_build_group_report_results, INDEX_NAME)
+ end
+end
diff --git a/db/schema_migrations/20210204212850 b/db/schema_migrations/20210204212850
new file mode 100644
index 00000000000..ffa4ca8393e
--- /dev/null
+++ b/db/schema_migrations/20210204212850
@@ -0,0 +1 @@
+2a40acf9a3ac2716120388cfe79be13130e4587286d215596e9c75097af1e436 \ No newline at end of file
diff --git a/db/schema_migrations/20210208144134 b/db/schema_migrations/20210208144134
new file mode 100644
index 00000000000..1afe893eba0
--- /dev/null
+++ b/db/schema_migrations/20210208144134
@@ -0,0 +1 @@
+845636d8a0c6e9b6b39194cb44ffeceea3464023c22fadb2a4da44fed5dd973f \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index e0cc67d365a..487b0728ccb 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -10381,7 +10381,8 @@ CREATE TABLE ci_daily_build_group_report_results (
ref_path text NOT NULL,
group_name text NOT NULL,
data jsonb NOT NULL,
- default_branch boolean DEFAULT false NOT NULL
+ default_branch boolean DEFAULT false NOT NULL,
+ group_id bigint
);
CREATE SEQUENCE ci_daily_build_group_report_results_id_seq
@@ -21631,6 +21632,8 @@ CREATE INDEX index_ci_builds_project_id_and_status_for_live_jobs_partial2 ON ci_
CREATE UNIQUE INDEX index_ci_builds_runner_session_on_build_id ON ci_builds_runner_session USING btree (build_id);
+CREATE INDEX index_ci_daily_build_group_report_results_on_group_id ON ci_daily_build_group_report_results USING btree (group_id);
+
CREATE INDEX index_ci_daily_build_group_report_results_on_last_pipeline_id ON ci_daily_build_group_report_results USING btree (last_pipeline_id);
CREATE INDEX index_ci_daily_build_group_report_results_on_project_and_date ON ci_daily_build_group_report_results USING btree (project_id, date DESC) WHERE ((default_branch = true) AND ((data -> 'coverage'::text) IS NOT NULL));
@@ -24726,6 +24729,9 @@ ALTER TABLE ONLY system_note_metadata
ALTER TABLE ONLY vulnerability_remediations
ADD CONSTRAINT fk_fc61a535a0 FOREIGN KEY (project_id) REFERENCES projects(id) ON DELETE CASCADE;
+ALTER TABLE ONLY ci_daily_build_group_report_results
+ ADD CONSTRAINT fk_fd1858fefd FOREIGN KEY (group_id) REFERENCES namespaces(id) ON DELETE CASCADE;
+
ALTER TABLE ONLY merge_requests
ADD CONSTRAINT fk_fd82eae0b9 FOREIGN KEY (head_pipeline_id) REFERENCES ci_pipelines(id) ON DELETE SET NULL;