ruby on rails - generate activerecord schema from an existing table -


does know of way this?

i have existing table created sql , create schema reproduce table (minus data)

  1. edit config/database.rb point database want copied.
  2. rake db:schema:dump
  3. create blank migration
  4. copy relevant create_table lines schema dump , paste migration file
  5. manually insert migration timestamp schema_migrations table (this applies existing setup has relevant table)

Comments

Popular posts from this blog

node.js - Mongoose: Cast to ObjectId failed for value on newly created object after setting the value -

[C++][SFML 2.2] Strange Performance Issues - Moving Mouse Lowers CPU Usage -

ios - Possible to get UIButton sizeThatFits to work? -