0.1.1 • Published 2 years ago

@teleology/migraine v0.1.1

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

@teleology/migraine

Taking the headache out of db migrations

Databases:

  • postgres
  • mysql
  • ... @todo more

Installation:

yarn add -D @teleology/migraine 

Usage:

Make sure the environment variable DATABASE_URL is exported in whatever cli you are currently using.

export DATABASE_URL='postgres://postgres:admin@localhost:5432/database?schema=public'

Commands

Show

To view which migrations you already have run:

migraine show

Create

Create a <filename>.up.sql and <filename>.down.sql:

migraine create <some random name>

*Note: all whitespace and uppercase characters will be converted to a lower snakecase.

Up

Run ALL migration files not previously ran:

migraine up

Run a specific number of up migrations:

migraine up -c <number>

Run a specific migration file:

migraine up -m <filename>

*Note: Do not include the .up.sql portion of the file name

Down

Revert ALL migration files and drop migraine table:

migraine down

Revert a specific number of migrations:

migraine down -c <number>

Revert a specific migration file:

migraine down -m <filename>

*Note: Do not include the .down.sql portion of the file name

0.1.1

2 years ago

0.1.0

2 years ago

0.0.7

2 years ago

0.0.6

2 years ago

0.0.5

2 years ago

0.0.4

2 years ago

0.0.3

2 years ago

0.0.2

2 years ago

0.0.1

2 years ago