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

Knex migrations #20

Merged
merged 5 commits into from
Jul 16, 2019
Merged

Knex migrations #20

merged 5 commits into from
Jul 16, 2019

Conversation

allishultes
Copy link
Contributor

Is your Pull Request request related to another issue in this repository ?
Issue: #11
Branched from database-spike.

Describe what the PR does

  • Transfers code from lib/db/setup.js to migration file.
  • Makes final adjustment to seed files so they run without errors.
  • Updates README to include information on how to migrate and seed database.

State whether the PR is ready for review or whether it needs extra work
Ready for review.

@allishultes allishultes requested a review from jamesdools July 16, 2019 12:09
ssh -f -L [port]:[rds name]:[port] [ssh] -N
```
#### Migrations
First, make sure you've installed Knex.js globally:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You can also run it via npx: this uses the executable in your node_modules. That's what I've been doing :)

@@ -0,0 +1,17 @@
const fs = require('fs');

exports.up = async (knex) => {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

cool!

README.md Outdated
@@ -34,6 +34,30 @@ npm install

alternatively for production is also on [npm](https://www.npmjs.com/package/@bbc/digital-paper-edit-api)

.env file should include:
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I don't know if this whole block is required. Perhaps just adding the empty DB parameters in the actual .env and mentioning it in the README 👍

@allishultes allishultes merged commit c4b32cb into database-spike Jul 16, 2019
@allishultes allishultes deleted the knex-migrations branch July 16, 2019 13:49
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

Successfully merging this pull request may close these issues.

2 participants