On Tue, May 29, 2012 at 10:40:04AM -0700, deitch wrote: > When I launch my app in test or dev, it runs a database initializer, > based on config file, that cleans out the db entirely, loads the > properties, loads the seed data. Works fine. > > Looking for a pattern for similar in production. > > a) Is there anything like "rake db:migrate" from Rails for node? > b) What patterns are people using? I am tempted to have the db > initialize split into two functions: initialize(), which runs > automatically in dev/test, which always cleans out and resets the db, > and validate(), which runs automatically in beta/prod and ensures that > the database properties are up to speed with the current version of > the properties description file but does not clean it out. > > e.g. new view "abc" wasn't in the last release, so I build it into my > db properties/schema file. Now every test will create it for local > test db. The moment I deploy (git using heroku, jitsu tools, manually, > whatever), that view will *not* be in my managed database, and I am > stuck. So validate() on launch ties properties to code version (good). > But modifying database every time app starts seems risky.
Recently announced by someone: https://github.com/mgutz/mygrate I thought it had the right goals. -- Alan Gutierrez - @bigeasy -- Job Board: http://jobs.nodejs.org/ Posting guidelines: https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines You received this message because you are subscribed to the Google Groups "nodejs" group. To post to this group, send email to [email protected] To unsubscribe from this group, send email to [email protected] For more options, visit this group at http://groups.google.com/group/nodejs?hl=en?hl=en
