You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The pre-populated database provided for learning/convenience creates a difficult snag when used in the context of the getting started tutorial: because the migrations tracked in the db by knex wont match the names of the migrations created during the getting started tutorial, knex will believe the migrations directory is corrupted. For example, upon server start:
> PATH_TO_DATABASE=riddles.db node server
[exiting] Fatal exception: Error: The migration directory is corrupt, the following files are missing: 20180420011654_add-riddles.js
I believe one of the main reasons to advertise the pre-populated db was to make it simple to have some persisted riddles without needing to create and re-create them across server starts while playing with the tutorial, so hopefully our solution will cater to this.
The text was updated successfully, but these errors were encountered:
Could you do the prepopulated, but delete the knex tables? That way it will start properly. It would probably cause issues when people start adding migration scripts for the existing tables.
It could be said that if you don't want to go through the migration stuff here is a prepopulated table...
Another option would be to create a part of the tutorial that goes over seeding a database with knex like @zemccartney mentioned.
@openam hey, thanks for that. I don't know for sure, but I'm guessing you're spot on that deleting any knex-related tables would lead to conflicts. Keeping the database clean, solely the purview of whoever's working through the tutorial, seems the safest way to go here.
And I totally agree addressing this issue will mean adding / revising the tutorial to walk people to new to pal through our approach
The pre-populated database provided for learning/convenience creates a difficult snag when used in the context of the getting started tutorial: because the migrations tracked in the db by knex wont match the names of the migrations created during the getting started tutorial, knex will believe the migrations directory is corrupted. For example, upon server start:
I believe one of the main reasons to advertise the pre-populated db was to make it simple to have some persisted riddles without needing to create and re-create them across server starts while playing with the tutorial, so hopefully our solution will cater to this.
The text was updated successfully, but these errors were encountered: