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

Create test database with Knex #37

Closed
stuartedward opened this issue Jun 26, 2021 · 5 comments
Closed

Create test database with Knex #37

stuartedward opened this issue Jun 26, 2021 · 5 comments
Assignees

Comments

@stuartedward
Copy link
Contributor

No description provided.

@JackiePease
Copy link
Contributor

@JackiePease
Copy link
Contributor

@stuartedward and I worked on this today. We were able to set up the system to reseed the test database with additional resources. Need to investigate further how to change from test to development databases using environment variables.

@amcewen
Copy link
Member

amcewen commented Jul 6, 2021

Reading https://gist.github.com/NigelEarle/70db130cc040cc2868555b29a0278261 is looks like you might be able to drop tables in knex with knex.schema.dropTable('name-of-table') (given @JackiePease and @stuartedward were looking for that t'other day)

@JackiePease
Copy link
Contributor

Added lines to db.js to read in environment variable NODE_ENV for use by the API. This now picks up the testing branch. Checked in the branch.

@JackiePease
Copy link
Contributor

Followed the instructions in the gist mentioned by @amcewen above to add a migration. The gist has a bug - it's missing "return" before "knex" in the Adding and Dropping Columns section.

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

3 participants