diff --git a/database/migrations/030_remove_opening_templates.sql b/database/migrations/030_remove_opening_templates.sql new file mode 100644 index 0000000..841606c --- /dev/null +++ b/database/migrations/030_remove_opening_templates.sql @@ -0,0 +1,18 @@ +-- Migration 030: Remove templates de abertura sem vinculo com a Meta +-- A migration 011 re-insere esses templates em todo deploy via ON CONFLICT DO UPDATE. +-- Este arquivo garante que sejam removidos caso nao estejam vinculados a Meta. + +DELETE FROM whatsapp_templates +WHERE name IN ( + 'abertura_atendimento_padrao', + 'abertura_retorno_contato', + 'abertura_suporte', + 'abertura_financeiro', + 'abertura_comercial', + 'abertura_confirmacao_dados', + 'abertura_contato_agendado', + 'abertura_pos_atendimento', + 'abertura_aviso_importante', + 'abertura_contato_inicial' +) +AND meta_template_name IS NULL;