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

gitlab.com/gitlab-org/gitaly.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn Cai <jcai@gitlab.com>2022-02-15 00:50:45 +0300
committerJohn Cai <jcai@gitlab.com>2022-02-28 18:50:25 +0300
commit1f416291f52e14c9c0721e9d6ed13fa6a4c2d127 (patch)
tree6faec352ced683d0f768feed4cc6599b9c8d6bba
parentb6e1f3ce3799d61cb7cdbd67952d82c126f44c4f (diff)
migrations: Add state and lock_id as indices on the replication_queue tablejc-add-replication-queue-indices
-rw-r--r--internal/praefect/datastore/migrations/20220214202822_replication_queue_state_lock_id_indices.go20
1 files changed, 20 insertions, 0 deletions
diff --git a/internal/praefect/datastore/migrations/20220214202822_replication_queue_state_lock_id_indices.go b/internal/praefect/datastore/migrations/20220214202822_replication_queue_state_lock_id_indices.go
new file mode 100644
index 000000000..549db4dff
--- /dev/null
+++ b/internal/praefect/datastore/migrations/20220214202822_replication_queue_state_lock_id_indices.go
@@ -0,0 +1,20 @@
+package migrations
+
+import migrate "github.com/rubenv/sql-migrate"
+
+func init() {
+ m := &migrate.Migration{
+ Id: "20220214202822_replication_queue_state_lock_id_indices",
+ Up: []string{
+ "CREATE INDEX CONCURRENTLY replication_queue_lock_id ON replication_queue (lock_id)",
+ "CREATE INDEX CONCURRENTLY replication_queue_state ON replication_queue (state)",
+ },
+ DisableTransactionUp: true,
+ Down: []string{
+ "DROP INDEX replication_queue_state",
+ "DROP INDEX replication_queue_lock_id",
+ },
+ }
+
+ allMigrations = append(allMigrations, m)
+}