feat: separate migration for indexes
This commit is contained in:
@@ -1,12 +1,5 @@
|
||||
class CreateConversationWithLabels < ActiveRecord::Migration[7.0]
|
||||
def change
|
||||
create_view :conversation_with_labels, materialized: true
|
||||
|
||||
add_index :conversation_with_labels, :id, unique: true
|
||||
add_index :conversation_with_labels, :account_id
|
||||
add_index :conversation_with_labels, :status
|
||||
add_index :conversation_with_labels, :custom_attributes, using: :gin
|
||||
add_index :conversation_with_labels, :labels_array, using: :gin
|
||||
add_index :conversation_with_labels, :last_activity_at, order: { last_activity_at: :desc }
|
||||
end
|
||||
end
|
||||
|
||||
@@ -0,0 +1,12 @@
|
||||
class AddIndexToConversationWithLabelsView < ActiveRecord::Migration[7.0]
|
||||
disable_ddl_transaction!
|
||||
|
||||
def change
|
||||
add_index :conversation_with_labels, :id, unique: true, algorithm: :concurrently
|
||||
add_index :conversation_with_labels, :account_id, algorithm: :concurrently
|
||||
add_index :conversation_with_labels, :status, algorithm: :concurrently
|
||||
add_index :conversation_with_labels, :custom_attributes, using: :gin, algorithm: :concurrently
|
||||
add_index :conversation_with_labels, :labels_array, using: :gin, algorithm: :concurrently
|
||||
add_index :conversation_with_labels, :last_activity_at, order: { last_activity_at: :desc }, algorithm: :concurrently
|
||||
end
|
||||
end
|
||||
+1
-1
@@ -10,7 +10,7 @@
|
||||
#
|
||||
# It's strongly recommended that you check this file into your version control system.
|
||||
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_06_02_120613) do
|
||||
ActiveRecord::Schema[7.0].define(version: 2023_06_02_123133) do
|
||||
# These are extensions that must be enabled in order to support this database
|
||||
enable_extension "pg_stat_statements"
|
||||
enable_extension "pg_trgm"
|
||||
|
||||
Reference in New Issue
Block a user