Reputation: 54984
Does anyone know of a way to do this?
I have an existing table that I created with sql and I would like to create a schema from it that would reproduce the table (minus the data)
Upvotes: 6
Views: 3366
Reputation: 14913
rake db:schema:dump
create_table
lines from the schema dump and paste it into the migration fileUpvotes: 11
Reputation: 3818
A schema is written in [your app]/db/schema.rb. Hope this help!
Upvotes: -2