summaryrefslogtreecommitdiff
path: root/db/migrate/20211101132310_add_reindexing_queue.rb
diff options
context:
space:
mode:
Diffstat (limited to 'db/migrate/20211101132310_add_reindexing_queue.rb')
-rw-r--r--db/migrate/20211101132310_add_reindexing_queue.rb16
1 files changed, 16 insertions, 0 deletions
diff --git a/db/migrate/20211101132310_add_reindexing_queue.rb b/db/migrate/20211101132310_add_reindexing_queue.rb
new file mode 100644
index 00000000000..d9d1f9dce89
--- /dev/null
+++ b/db/migrate/20211101132310_add_reindexing_queue.rb
@@ -0,0 +1,16 @@
+# frozen_string_literal: true
+
+class AddReindexingQueue < Gitlab::Database::Migration[1.0]
+ def change
+ create_table :postgres_reindex_queued_actions do |t|
+ t.text :index_identifier, null: false, limit: 255
+ t.integer :state, limit: 2, null: false, default: 0
+ t.timestamps_with_timezone null: false
+
+ t.index :state
+ end
+
+ change_column_default :postgres_reindex_queued_actions, :created_at, from: nil, to: -> { 'NOW()' }
+ change_column_default :postgres_reindex_queued_actions, :updated_at, from: nil, to: -> { 'NOW()' }
+ end
+end