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-12-01 15:16:08 +0300
committerGitLab Bot <gitlab-bot@gitlab.com>2021-12-01 15:16:08 +0300
commitc9439a09c51acff525f2e5c5cba8caecc270da8b (patch)
treecd344f3ce05525dccbc5f7d607d3fd1e76b46cd2 /db
parent7bc1ee0bcb9cefaf788aa0b93383b7347e9010b0 (diff)
Add latest changes from gitlab-org/gitlab@master
Diffstat (limited to 'db')
-rw-r--r--db/post_migrate/20211130201100_track_deletions_in_namespaces.rb15
-rw-r--r--db/post_migrate/20211130201101_track_deletions_in_projects.rb15
-rw-r--r--db/schema_migrations/202111302011001
-rw-r--r--db/schema_migrations/202111302011011
-rw-r--r--db/structure.sql4
5 files changed, 36 insertions, 0 deletions
diff --git a/db/post_migrate/20211130201100_track_deletions_in_namespaces.rb b/db/post_migrate/20211130201100_track_deletions_in_namespaces.rb
new file mode 100644
index 00000000000..e688e0b467d
--- /dev/null
+++ b/db/post_migrate/20211130201100_track_deletions_in_namespaces.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class TrackDeletionsInNamespaces < Gitlab::Database::Migration[1.0]
+ include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
+
+ enable_lock_retries!
+
+ def up
+ track_record_deletions(:namespaces)
+ end
+
+ def down
+ untrack_record_deletions(:namespaces)
+ end
+end
diff --git a/db/post_migrate/20211130201101_track_deletions_in_projects.rb b/db/post_migrate/20211130201101_track_deletions_in_projects.rb
new file mode 100644
index 00000000000..dfe7ab4c037
--- /dev/null
+++ b/db/post_migrate/20211130201101_track_deletions_in_projects.rb
@@ -0,0 +1,15 @@
+# frozen_string_literal: true
+
+class TrackDeletionsInProjects < Gitlab::Database::Migration[1.0]
+ include Gitlab::Database::MigrationHelpers::LooseForeignKeyHelpers
+
+ enable_lock_retries!
+
+ def up
+ track_record_deletions(:projects)
+ end
+
+ def down
+ untrack_record_deletions(:projects)
+ end
+end
diff --git a/db/schema_migrations/20211130201100 b/db/schema_migrations/20211130201100
new file mode 100644
index 00000000000..80c2d68671b
--- /dev/null
+++ b/db/schema_migrations/20211130201100
@@ -0,0 +1 @@
+cc0146769929c9fbb0b7b6788826d2e188c8664a14e1015563ba4f9e65397c4e \ No newline at end of file
diff --git a/db/schema_migrations/20211130201101 b/db/schema_migrations/20211130201101
new file mode 100644
index 00000000000..ef1178c10c5
--- /dev/null
+++ b/db/schema_migrations/20211130201101
@@ -0,0 +1 @@
+b0215ac45031593ca98de4f8858d21f1c29af03742a422bffd83598e39a6871c \ No newline at end of file
diff --git a/db/structure.sql b/db/structure.sql
index b8c75e33e7b..a932ea30de5 100644
--- a/db/structure.sql
+++ b/db/structure.sql
@@ -28729,6 +28729,10 @@ CREATE TRIGGER ci_pipelines_loose_fk_trigger AFTER DELETE ON ci_pipelines REFERE
CREATE TRIGGER ci_runners_loose_fk_trigger AFTER DELETE ON ci_runners REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
+CREATE TRIGGER namespaces_loose_fk_trigger AFTER DELETE ON namespaces REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
+
+CREATE TRIGGER projects_loose_fk_trigger AFTER DELETE ON projects REFERENCING OLD TABLE AS old_table FOR EACH STATEMENT EXECUTE FUNCTION insert_into_loose_foreign_keys_deleted_records();
+
CREATE TRIGGER trigger_delete_project_namespace_on_project_delete AFTER DELETE ON projects FOR EACH ROW WHEN ((old.project_namespace_id IS NOT NULL)) EXECUTE FUNCTION delete_associated_project_namespace();
CREATE TRIGGER trigger_has_external_issue_tracker_on_delete AFTER DELETE ON integrations FOR EACH ROW WHEN ((((old.category)::text = 'issue_tracker'::text) AND (old.active = true) AND (old.project_id IS NOT NULL))) EXECUTE FUNCTION set_has_external_issue_tracker();