Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How are we handling DB migration? #337

Closed
Zren opened this issue Aug 28, 2014 · 2 comments
Closed

How are we handling DB migration? #337

Zren opened this issue Aug 28, 2014 · 2 comments
Labels
team biz This is similar to a meta discussion.

Comments

@Zren
Copy link
Contributor

Zren commented Aug 28, 2014

@sizzlemctwizzle & whoever else has access to the production db.

This came up in #335. How do you want me to handle migration?

Personally, I'd prefer having a ./models/migration/ folder, with scripts called 2014-08-28.js which would connect with mongoose normally, but run operations. They'd accept the CONNECT_URI env var. These would have to be run by someone with access to the db however.

Another option would be to version our schema, then run scripts automatically on server run. This'd be a pain to implement as we'd have to write an entire migration feature ourselves unless someone knows one.

Thirdly, we could lazily migrate (which is how you normally handle schemaless databases) in which each document will be updated as it's updated.

@Zren Zren added the team biz label Aug 28, 2014
@Martii
Copy link
Member

Martii commented Aug 28, 2014

This is definitely a @sizzlemctwizzle thing. I don't have access to the DB and possibly won't. Migrations of the DB are handled currently by sizzle directly. It would be helpful to have something development side here on GH though. See related #233, #285 and probably some more with DB migrations/alterations needed. GM just finalized the metadata block syntax today with version 2.2. So we have a bit to catch up on although our parseMeta routine is "safe" from destruction albeit incorrect at the moment.

@sizzlemctwizzle
Copy link
Member

I've mostly done lazy migration in the past. But when I got the namespace
slug out of installName I used a script. I prefer lazy migration and only
using a script when that isn't enough.
On Aug 28, 2014 3:38 PM, "Chris Holland" notifications@github.com wrote:

@sizzlemctwizzle https://github.com/sizzlemctwizzle & whoever else has
access to the production db.

This came up in #335
#335. How do you want
me to handle migration?

Personally, I'd prefer having a ./models/migration/ folder, with scripts
called 2014-08-28.js which would connect with mongoose normally, but run
operations. They'd accept the CONNECT_URI env var. These would have to be
run by someone with access to the db however.

Another option would be to version our schema, then run scripts
automatically on server run. This'd be a pain to implement as we'd have to
write an entire migration feature ourselves unless someone knows one.

Thirdly, we could lazily migrate (which is how you normally handle
schemaless databases) in which each document will be updated as it's
updated.


Reply to this email directly or view it on GitHub
#337.

@Zren Zren closed this as completed Oct 15, 2014
@OpenUserJS OpenUserJS locked as resolved and limited conversation to collaborators Apr 12, 2021
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
team biz This is similar to a meta discussion.
Development

No branches or pull requests

3 participants