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

Migrating the database #15

Open
jcalfee opened this issue May 6, 2020 · 2 comments
Open

Migrating the database #15

jcalfee opened this issue May 6, 2020 · 2 comments

Comments

@jcalfee
Copy link
Contributor

jcalfee commented May 6, 2020

Updating the database in a live system

First: always make the change in the sequelize JavaScirpt model definition so it will be available in the code as JavaScript objects (ex: registrations/server/db/models/wallet.js). This makes it much easier to work with the database.

Currently I make the change locally (in my database) then document the DDL (sql changes) in fio-registrations/UPGRADE.md. This works but complicates upgrades because it is manual.

In any event, include any changes in server/db/models/* in UPGRADE.md..

@jcalfee
Copy link
Contributor Author

jcalfee commented May 6, 2020

The sequelize migrations and seed solution may not play well well new installs and with upgrades. They will tend to run on new installs but the sync target creates all tables after all migrations are applied. Additionally I had an error in the migration when I tried to run raw DDL. I think a custom migration solution may be needed if we are to remove the need to update and run DDL from UPGRADE.md.

@jcalfee
Copy link
Contributor Author

jcalfee commented May 6, 2020

A migration should either the [major].x.x or x.[minor].x version in package.json (probably the major).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant