* feat(zapi): connect flow and UI updates * fix(zapi): re-add manage connection section * feat(zapi): reply * feat: send message * fix: qrcode job logic * test: qr code job specs * chore: concurrent index * chore: whatsapp model minor * test: message window service specs * chore: service refactor * test: zapi service * chore: zapi beta * chore: minor fixes * test: incoming message specs * chore: minor fixes * feat: handle status transitions * test: refactor spec * test: refactor spec * chore(z-api): use feature flag * chore: fix migration name
24 lines
832 B
Ruby
24 lines
832 B
Ruby
class RecreateWhatsappChannelProviderConnectionIndex < ActiveRecord::Migration[7.1]
|
|
disable_ddl_transaction!
|
|
|
|
def up
|
|
remove_index :channel_whatsapp, name: 'index_channel_whatsapp_baileys_connection', if_exists: true
|
|
|
|
add_index :channel_whatsapp, :provider_connection,
|
|
using: :gin,
|
|
where: "provider IN ('baileys', 'zapi')",
|
|
name: 'index_channel_whatsapp_provider_connection',
|
|
algorithm: :concurrently
|
|
end
|
|
|
|
def down
|
|
remove_index :channel_whatsapp, name: 'index_channel_whatsapp_provider_connection', if_exists: true
|
|
|
|
add_index :channel_whatsapp, :provider_connection,
|
|
using: :gin,
|
|
where: "provider = 'baileys'",
|
|
name: 'index_channel_whatsapp_baileys_connection',
|
|
algorithm: :concurrently
|
|
end
|
|
end
|