Correção falha na migration da ultima atualização
This commit is contained in:
@@ -9,7 +9,12 @@
|
||||
class CreateNotificacaoEnvios < ActiveRecord::Migration[7.1]
|
||||
def change
|
||||
create_table :notificacao_envios do |t|
|
||||
t.references :evento_notificacao, foreign_key: true, index: 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, foreign_key: { to_table: :eventos_notificacao }, index: true
|
||||
t.references :contato, foreign_key: true, index: true
|
||||
t.references :user, foreign_key: true, index: true
|
||||
|
||||
|
||||
Reference in New Issue
Block a user