1.1.8 • Published 5 years ago

@smpx/knex-utils v1.1.8

Weekly downloads
1
License
MIT
Repository
github
Last release
5 years ago

knex-utils

It is a set of utility functions for use with knex and knex migrations. Mostly aimed at PostgreSQL.

CLI:

Usage: knex-utils [options] [command]

Options:
  -V, --version     output the version number
  -h, --help        output usage information

Commands:
  refresh
  create [options]

For knex-utils create :

Usage: knex-utils create [options]

Options:
  -m, --migrate  Run migrations too after creating DB
  -h, --help     output usage information

KnexFile:

The cwd should have a knexfile.js, this is used by knex to connect to the DB.

Reference : https://knexjs.org/#knexfile

Consolidate:

ONLY WORKS WITH POSTGRESQL

Tool to consolidate all existing schema migrations into one migration and corresponding tables folder with one file for each table.

Supported types for columns:

  • integer
  • increments
  • string
  • jsonb
  • timestamp
  • text
  • boolean
  • float
  • decimal
  • enum
  • specificType : - citext

Supported Modifiers:

  • unique
  • index
  • primary
  • composite primary keys
  • nullable
  • notNullable
  • defaultTo
  • maxLength for string
  • numeric_precision for numeric

TODO:

Not supported (for now?):

  • Custom indexes not on columns directly
  • Functions
  • native types
1.1.8

5 years ago

1.1.7

5 years ago

1.1.6

5 years ago

1.1.5

5 years ago

1.1.4

5 years ago

1.1.3

5 years ago

1.1.2

5 years ago

1.1.1

5 years ago

1.1.0

5 years ago

1.0.7

5 years ago

1.0.6

5 years ago

1.0.5

5 years ago

1.0.4

5 years ago

1.0.3

5 years ago

1.0.2

6 years ago

1.0.1

6 years ago

1.0.0

6 years ago