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
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20220902065316_create_default_partition_record.rb')
-rw-r--r--db/migrate/20220902065316_create_default_partition_record.rb21
1 files changed, 21 insertions, 0 deletions
diff --git a/db/migrate/20220902065316_create_default_partition_record.rb b/db/migrate/20220902065316_create_default_partition_record.rb
new file mode 100644
index 00000000000..6493fb23d4c
--- /dev/null
+++ b/db/migrate/20220902065316_create_default_partition_record.rb
@@ -0,0 +1,21 @@
+# frozen_string_literal: true
+
+class CreateDefaultPartitionRecord < Gitlab::Database::Migration[2.0]
+ disable_ddl_transaction!
+ restrict_gitlab_migration gitlab_schema: :gitlab_ci
+
+ def up
+ execute(<<~SQL)
+ INSERT INTO "ci_partitions" ("id", "created_at", "updated_at")
+ VALUES (100, now(), now());
+ SQL
+
+ reset_pk_sequence!('ci_partitions')
+ end
+
+ def down
+ execute(<<~SQL)
+ DELETE FROM "ci_partitions" WHERE "ci_partitions"."id" = 100;
+ SQL
+ end
+end