It is a set of utility functions for use with knex and knex migrations. Mostly aimed at PostgreSQL.
Usage: knex-utils [options] [command]
Options:
-V, --version output the version number
-h, --help output usage information
Commands:
refresh
create [options]
consolidate
Usage: knex-utils create [options]
Options:
-m, --migrate Run migrations too after creating DB
-h, --help output usage information
The cwd should have a knexfile.js, this is used by knex to connect to the DB.
Reference : https://knexjs.org/#knexfile
NOTE: ONLY WORKS WITH POSTGRESQL
Tool to consolidate all existing schema migrations into one migration and corresponding tables folder with one file for each table.
- integer
- increments
- string
- jsonb
- timestamp
- text
- boolean
- float
- decimal
- enum
- specificType:
- citext
- unique
- index
- primary
- composite primary keys
- nullable
- notNullable
- defaultTo
- maxLength for string
- numeric_precision for numeric
- Handle Partitions:
- Could look at code for Migra
- https://dba.stackexchange.com/questions/40441/get-all-partition-names-for-a-table
- Custom indexes not on columns directly
- Functions
- native types