0

I found the answer here unhelpful: Rails 3 Add Foreign Key in Migration Problems

Implementing a namedspaced branch of the mailboxer gem I'm getting problems with the following:

add_foreign_key "mailboxer_receipts", "mailboxer_notifications", :name => "receipts_on_notification_id"
#Messages  
add_foreign_key "mailboxer_notifications", "mailboxer_conversations", :name => "notifications_on_conversation_id"
add_foreign_key :pairs, :programmers,
     :source_column => :second_id,
     :name => :fk_second_programmer

The full file is here: https://github.com/daveworth/mailboxer/blob/namedspaced/db/migrate/20110511145103_create_mailboxer.rb

The documentation here didn't help me: http://araddconstraint.rubyforge.org/classes/ActiveRecord/ConnectionAdapters/SchemaStatements.html

The last foreign key appears to be copied from the documentation link above (???). The errors complained about the name of the foreign key which shouldn't matter - which makes me think it's a syntax error.

Community
  • 1
  • 1
Archonic
  • 5,207
  • 5
  • 39
  • 55

1 Answers1

2

I needed a gem called foreigner as it wasn't listed as a dependency in mailboxer. A fork of mailboxer fixes the namespace issue but mailboxer is dead and I recommend avoiding it.

Archonic
  • 5,207
  • 5
  • 39
  • 55