Skip to content

Sample to use knex migrations with PostgreSQL and Typescript support.

Notifications You must be signed in to change notification settings

jfollmann/knex-migrations-ts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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

About

Sample to use knex migrations with PostgreSQL and Typescript support.

Topics

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published