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

SPIKE: Investigate knex-migrator improvements #503

Closed
acburdine opened this issue Oct 18, 2017 · 1 comment
Closed

SPIKE: Investigate knex-migrator improvements #503

acburdine opened this issue Oct 18, 2017 · 1 comment
Assignees

Comments

@acburdine
Copy link
Member

acburdine commented Oct 18, 2017

Summary

One of the most frequent problems that I've seen in both Slack and in the various issues created here is with database migrations (surprise surprise), especially where sqlite is concerned, since it requires native bindings that are specific to the individual version of node.

The most often problem that happens is a user installs ghost-cli, then installs a new version of node via nvm or something similar, and then tries to install Ghost. Database migration fails because knex-migrator's sqlite dependency installed in ghost-cli is for an older version of node, causing database migrations to fail.

There's a couple of things that I think can be done to improve this, which need to be investigated

  • Run knex-migrator programmatically rather than as a sub-command

This was actually the case a while back, until we added in the ghost system user which necessitated a switch to running it via a subprocess. If we can get it running programmatically, and then run migrations via a subcommand only when we need to run it as the ghost system user, this will likely improve usage/error messages/etc.

  • Use the knex-migrator version that's installed with Ghost itself and drop the required dep in ghost-cli

This should (hopefully) see significant improvements in the database migration flow. By moving the requirement into Ghost (where knex-migrator is already installed) we accomplish several things:

  • no native dependencies installed with Ghost-CLI
  • removing the "node version is the same that installed ghost-cli" check
  • if any important knex-migrator fixes are shipped with Ghost, Ghost-CLI doesn't need to release a new version in order to get those same fixes

However, this change will need to be verified to ensure that requiring the version installed with Ghost will actually work 😅

@acburdine acburdine self-assigned this Oct 18, 2017
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Oct 21, 2017
refs TryGhost#503
- use knex-migrator version installed with Ghost itself
- remove global knex-migrator dependency
- remove "same node version" check
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Oct 21, 2017
refs TryGhost#503
- use knex-migrator version installed with Ghost itself
- remove global knex-migrator dependency
- remove "same node version" check
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Oct 21, 2017
refs TryGhost#503
- use knex-migrator version installed with Ghost itself
- remove global knex-migrator dependency
- remove "same node version" check
acburdine added a commit to acburdine/Ghost-CLI that referenced this issue Nov 10, 2017
refs TryGhost#503
- use knex-migrator version installed with Ghost itself
- remove global knex-migrator dependency
- remove "same node version" check
kirrg001 pushed a commit that referenced this issue Nov 10, 2017
refs #503

- use knex-migrator version installed with Ghost itself
- remove global knex-migrator dependency
- remove "same node version" check
@acburdine
Copy link
Member Author

Closed by #505

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

No branches or pull requests

1 participant