2021-08-03 05:15:56 -04:00
|
|
|
# frozen_string_literal: true
|
|
|
|
|
|
|
|
class CreatePostgresAsyncIndexesTable < ActiveRecord::Migration[6.1]
|
|
|
|
include Gitlab::Database::MigrationHelpers
|
|
|
|
|
2022-01-27 10:14:51 -05:00
|
|
|
def up
|
2021-08-03 05:15:56 -04:00
|
|
|
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
|
2022-01-27 10:14:51 -05:00
|
|
|
|
|
|
|
def down
|
|
|
|
with_lock_retries do
|
|
|
|
drop_table :postgres_async_indexes
|
|
|
|
end
|
|
|
|
end
|
2021-08-03 05:15:56 -04:00
|
|
|
end
|