Actions
Support #2133
openprod2dev feature should be able to downgrade dev schema to be able to import production data
Status:
New
Priority:
Normal
Assignee:
-
Category:
DB migrations
Target version:
-
Triaged:
Fixed in Releases:
Found in Releases:
Description
My use case is this one :
I have a production db with a fixed schema. When I evaluate the master branch in
a development environment I want to be able to import data easily from production.
For now I do it by hand :
I have a production db with a fixed schema. When I evaluate the master branch in
a development environment I want to be able to import data easily from production.
For now I do it by hand :
- drop dev db
- create a new one
- dump prod db
- insert it in dev db
If prod2dev task would be able to support that dev schema is not the same as prod's one it would
make (my) one's life much more easier !
Updated by Greg Sutcliffe over 12 years ago
If you create the dev db on the production server, then it will have the same schema as the production db, since it's the same code. The workflow I use for this scenario is:
export RAILS_ENV=development
rake db:drop
rake db:migrate
rake db:convert:prod2dev
git checkout -t -b develop origin/develop
rake db:migrate
rails server
Thus, the dev db is created before the git pull, and is thus exactly the same schema as prod.
We could probably make this easier though, agreed.
Actions