Correção falha na migration da ultima atualização
This commit is contained in:
@@ -36,8 +36,13 @@ class CreateNotificacaoEventos < ActiveRecord::Migration[7.1]
|
||||
add_index :eventos_notificacao, :chave, unique: true
|
||||
|
||||
create_table :grupo_evento_assinaturas do |t|
|
||||
t.references :grupo_contato, null: false, foreign_key: true
|
||||
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 :grupo_contato, null: false, foreign_key: { to_table: :grupos_contato }
|
||||
t.references :evento_notificacao, null: false, foreign_key: { to_table: :eventos_notificacao }
|
||||
t.string :canal, null: false, default: 'ambos' # ambos | whatsapp | email
|
||||
t.boolean :ativo, null: false, default: true
|
||||
t.timestamps
|
||||
|
||||
Reference in New Issue
Block a user