db-migrate / db-migrate/node-db-migrate

Working with newly created db for migrations in postgres

Open
#723 0 comments 0 reactions 0 assignees View on GitHub
Dominant language
JavaScript
Stars
2.3k
Forks
361
PR merge metrics
No merged PRs in 30d

Description

## I'm submitting a...

- [x] Bug report
- [x] Feature request
- [x] Question

Hey, I'm using node-db-migrate to test e2e database api
I'm trying to create a new db and then run the migrates on it however it doesn't seem to work on postgres.

this is my database.json

{
"test": {
"driver": "pg",
"user": "postgres",
"password": "postgres",
"host": "localhost",
"database": "postgres",
"port": "5432"
}
}

this is the stages i did.

create a new db

db-migrate db:create testDB --config test/database.json -e test

create a new migration

db-migrate create migrationname -e test --config test/database.json --sql-file

in the sql

CREATE SCHEMA test;

CREATE TABLE test.Persons (
PersonID int,
LastName varchar(255),
FirstName varchar(255),
Address varchar(255),
City varchar(255)
);

now i should be using the db-migrate up command such as

db-migrate up --config test/database.json -e test

however my problem is that i can't find a way to use the sql migration on the new db.

I'm actively trying to avoid setting it statically in the json because in my use case the db name is changing per execution

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.