Skip to content

Latest commit

 

History

History
55 lines (42 loc) · 898 Bytes

README.md

File metadata and controls

55 lines (42 loc) · 898 Bytes

Sample knex migrations with Typescript

Sample to use knex migrations with PostgreSQL and Typescript support.

🚀 Startup

Start PostgreSQL container (with docker-compose):

docker-compose up -d

Create your db in PostgreSQL:

create database "knexDB"

☕ Migrations

Create migration file:

npm run migrate:make [name-of-migration]

Update your database to last version:

npm run migrate:latest

Rollback all migrations

npm run migrate:rollback --all

Show completed and pending migrations:

npm run migrate:list

Show db currentVersion:

npm run migrate:currentVersion

👌 Seeds

Create seed file:

npm run seed:make [name-of-seed]

Run all seeds:

npm run seed:run

Others commands in reference document