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

20210720140841_create_postgres_async_indexes_table.rb « migrate « db - gitlab.com/gitlab-org/gitlab-foss.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 99025149840c1c2716edc06cb1f43578bf598ee3 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
# frozen_string_literal: true

class CreatePostgresAsyncIndexesTable < ActiveRecord::Migration[6.1]
  include Gitlab::Database::MigrationHelpers

  def up
    create_table_with_constraints :postgres_async_indexes do |t|
      t.timestamps_with_timezone null: false

      t.text :name, null: false
      t.text :definition, null: false
      t.text :table_name, null: false

      t.text_limit :name, 63
      t.text_limit :definition, 2048
      t.text_limit :table_name, 63

      t.index :name, unique: true
    end
  end

  def down
    with_lock_retries do
      drop_table :postgres_async_indexes
    end
  end
end