Correção falha na migration da ultima atualização
This commit is contained in:
@@ -11,7 +11,12 @@
|
||||
class CreateMensagemTemplates < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :mensagem_templates do |t|
|
||||
t.references :evento_notificacao, null: false, foreign_key: true
|
||||
# ⚠️ `to_table:` é OBRIGATÓRIO aqui. Com `foreign_key: true` o Rails
|
||||
# PLURALIZA o nome da referência para achar a tabela alvo, e o Inflector
|
||||
# não fala português: `grupo_contato` → "grupo_contatos" e
|
||||
# `evento_notificacao` → "evento_notificacaos". As tabelas reais são
|
||||
# `grupos_contato` e `eventos_notificacao` (plural no primeiro termo).
|
||||
t.references :evento_notificacao, null: false, foreign_key: { to_table: :eventos_notificacao }
|
||||
|
||||
t.string :canal, null: false # whatsapp | email
|
||||
t.string :assunto # só e-mail
|
||||
|
||||
Reference in New Issue
Block a user