0

I have a knex powered app that once I clone from github, I can run yarn migrate:latest to get the database up to date.

The problem is, in some cases, like a new developer, the database might not yet exist.

What is the right way to first create the database? Do I need to do that outside of KNEX or is there a KNEX CLI/Migration type of commend for this need?

1
  • easiest way, create database externally. If you like to do it on migration, you have to create migration file which should be the first file on migration folder. Commented Nov 30, 2017 at 7:31

1 Answer 1

1

Thats not supported (knex 0.14.2). You need to create database + db users in advance. If you like to have node library helping in that knex-db-manager is knex based helper lib for database management like creating DBs and db owner user etc.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.