Open brendanebers opened 9 years ago
Brendan, does the production DB exist? Have you already applied migrations to it?
I will probably clean things up so we can have either multiple db manage scripts or at least more configurable manage scripts. That way we can easily support running migrations both locally and remotely. For example, I have both a local PostgreSQL instance for development and a Pgsql instance running on Heroku for testing. Plus you have your copies as well...
Also, it would make life easier going forward to have some consistency in database conventions. What are you currently calling your database? And what is the name of the primary database username?
So, I'm not sure if it's worth writing a script for this. You can use the pg_dump
tool to extract the schema and data from one database and load it into another database:
pg_dump -h mydb.com -p 5432 -d wheres -U wheres_admin -T migrate_version \
| psql -h localhost -d wheres_local -U wheres_local
I could still create something if you really want it. But I can't test Windows batch files...
Because I'm lazy and prefer doing-it-live against a real database, I'm going to unassign this one
Instead of directly playing with the production db, we should probably develop off of a local one.