Migration Trouble

25 views
Skip to first unread message

Jan Yo

unread,
Sep 18, 2014, 7:52:05 PM9/18/14
to rubyonra...@googlegroups.com
I'm having an issue with one migration. all other migrations work ok.

Here's the output:
== 20140905145859 CreateMemberships: migrating
================================
-- create_table(:memberships)
-> 0.3010s
== 20140905145859 CreateMemberships: migrated (0.3011s)
=======================


But here's what it looks like in rails c:
Loading development environment (Rails 4.0.5)
2.0.0-p481 :001 > Membership
=> Membership()

Here's the content of the migration:
class CreateMemberships < ActiveRecord::Migration
def change
create_table :memberships do |t|
t.string :user_id

t.timestamps
end
end
end


Any ideas why this one migration has problems?

--
Posted via http://www.ruby-forum.com/.

Matt Jones

unread,
Sep 19, 2014, 8:40:58 PM9/19/14
to rubyonra...@googlegroups.com
If you do `Membership.first` in the console, what happens?

Usually when this sort of weirdness happens to me, it's because some other class/module in the app is getting named `Membership`, which makes a real mess.

--Matt Jones 

Jan Yo

unread,
Sep 21, 2014, 7:24:10 PM9/21/14
to rubyonra...@googlegroups.com
That was it! Thanks.
Reply all
Reply to author
Forward
0 new messages