Re:Reversible Migrations in Rails 3.1
by fernandotakai on Saturday May 07, 2011 @08:05PM
(#2524913)
I don't know, but i think that looking at models/yourmodel.py is easier. But well, this is me (and also, i came from a hibernate/spring background).
And for 'newbies', it's more intuitive to look for a class model than to look for sql schema.
I just pop open db/schema.rb and then search for where the users table schema is described. This .rb file is automatically generated. In production systems, I actually configure it to use db/schema.sql which stores the SQL schema instead of the Ruby schema, since my production database has indexes that Rail's migrations can't describe directly.
Or even more directly:
Which I typically run from vim: And that just prints out the description of the table for me.