It's pronounced Diane. I do data architecture, operations, and backend development. In my spare time I maintain Massive.js, a data mapper for Node.js and PostgreSQL.
It's a rite of passage. Welcome! And next time use a migration framework (I like sqitch)so you can reconstitute databases when and where you want them :)
Rails already has its own migration framework, which devise uses to set up the database changes needed for it to work.
I guess what Saral did wrong is not that he forgot to use migrations, but rather, to make a backup of the database.
If you are using PostgreSQL (which I recommend, it is way better than MySQL), you can use this command to create a copy of your DB:
createdb -T development_db development_db_copy
And when you want to restore your working copy to the backup, this one liner will drop the current one, create it from your backup and run rails db:migrate to bring everything up to date:
It's a rite of passage. Welcome! And next time use a migration framework (I like sqitch)so you can reconstitute databases when and where you want them :)
Rails already has its own migration framework, which devise uses to set up the database changes needed for it to work.
I guess what Saral did wrong is not that he forgot to use migrations, but rather, to make a backup of the database.
If you are using PostgreSQL (which I recommend, it is way better than MySQL), you can use this command to create a copy of your DB:
And when you want to restore your working copy to the backup, this one liner will drop the current one, create it from your backup and run
rails db:migrate
to bring everything up to date:Yeap. I think this definitely does address my issue and how I could have worked around it. Will give it a go next time I am working with my database.
Thank you Patricio. :D
Thanks. :) I will definitely look into sqitch and learn to use them.