2646 Commits

Author SHA1 Message Date
Igor Savin
7ecbcd5d19
Update changelog and version number (#3108) 2019-03-13 23:25:11 +01:00
Igor Savin
5fea86eeae
Update dependencies (#3107) 2019-03-13 23:24:46 +01:00
elunic
19926d8eba [#3033] fix: sqlite3 drop/renameColumn() breaks with postProcessResponse (#3040)
* [#3033] fix: sqlite3 drop/renameColumn() breaks with postProcessResponse

* When postProcessResponse is configured, and client.processResponse()
returns a Promise (e.g. for custom cases such as sqlite3 dropColumn()),
then that Promise is not awaited, but handed to postProcessResponse,
which might break is (e.g. with Objection's knexSnakeCaseMappers()).

* when reinserting data in the modified table, the rows are now being
handled with the "mapped" identifiers (instead of the unmapped)

* add tests, fix hasColumn

* add hasColumn tests for add mysql + snakeCaseMappers

* Improve tests and fix more cases related to processing

* Fix SQLite-specific tests

* MySQL is not case-sensitive, pg is
2019-03-13 22:58:59 +01:00
Igor Savin
24fcf27e05
Fix transaction support for migrations (#3084)
* Fix transaction support for migrations

* Clarify warning

* Clarify warning message

* Simplify logic, make enabling/disabling more consistent

* Fix tests

* Fix test

* Reduce duplication
2019-03-13 22:47:43 +01:00
Iacami Gevaerd
de1c9341b3 Include 'string' as accepted Knex constructor type definition (#3105) 2019-03-12 23:03:02 +01:00
Pierre Voisin
0aacab50be Fix for #2998 - Migrator & TypeScript (#3041)
* Fix `#listAllAndCompleted` not considering `loadExtensions` in migrator configuration (#2998)

* Add unit test

* Fix linting
2019-03-09 23:39:55 +01:00
Igor Savin
fcd21d9bf3
Add command for executing tests on SQLite (#3101) 2019-03-09 21:00:39 +01:00
Daniel Hensby
1da56a38d3 Update mssql dev dep to v5 stable (#3096) 2019-03-08 21:40:41 +01:00
Igor Savin
b9a648c6c4
Format code (#3088) 2019-03-05 18:46:58 +01:00
EthanHur
0db785949b add test that clearing offset (#2954)
* add test that clearing offset

* fix typo
2019-03-05 16:25:30 +01:00
Felix Mosheev
f3f075095b Make TS stubs modern (#3080) 2019-03-05 15:37:43 +01:00
Igor Savin
68723e025d
Update changelog (#3086) 2019-03-05 01:16:15 +01:00
Igor Savin
1b39d67550
Tests for drop-and-recreate with async/await (#3083)
* Add test for drop-and-recreate with async/await

* Add some tests with schema

* Use correct migrations

* Add tests with promise chains for comparison

* Fix migration

* Fix Node 6 compatibility
2019-03-05 01:03:51 +01:00
Randy Garces
c2bf7a375c MSSQL removes support column width/length on data type int and tinyint (#2738)
* MSSQL remove support column width/length on data type int

- fixes error `Cannot specify a column width on data type int`
- ignore length even if pass as agrument

* Add integration test for numeric lengths

* Fix syntax

* Add test that actually executes SQL

* Fix failing tests

* Fix tests
2019-03-05 01:02:06 +01:00
Chathu Vishwaijith
cfcb55d1c4 Add size parameter to integer method (#3074)
* Add size parameter to integer method

Size parameter work when we pass it. But it's not in definition.

* Change parameter to length

* Update knex.d.ts

Fix typo
2019-03-04 13:04:11 +01:00
Igor Savin
b269e45842
Update dependencies (#3085)
* Update dependencies

* Fix linting errors
2019-03-04 01:40:35 +01:00
Will
a109a801b0 Update enum arguments to reflect latest signature (#3043)
* Update enum arguments to reflect latest signature

Reimplemented from https://github.com/DefinitelyTyped/DefinitelyTyped/pull/29946

* Update knex.d.ts

Add missing option for PostgreSQL
2019-03-04 00:11:36 +01:00
Igor Savin
a84b0974d4
Fix security warning (#3082) 2019-03-03 23:31:57 +01:00
thekuom
71e097b663 add intersect() (#3023)
* add intersect()

* update intersect integration tests to validate results

* use const instead of var, remove .only in test, remove commented out type
2019-03-03 20:57:40 +01:00
EthanHur
dfe01298d2 mysql warn .returning() does not have any effect. (#3039)
* mysql warn `.returning()` does not have any effect.

* add test if warning is emitted or not
2019-03-03 14:53:06 +02:00
Igor Savin
15ac75cda0
Do not bundle polyfills with knex (#3024) 2019-01-31 13:54:29 +01:00
Simon Lidén
e7c674e4dd
Fix fs-migrations breaking docs (#3022)
`fs` does not exist in the browser, causing errors such as: Uncaught TypeError: expecting a function but got [object Undefined]
2019-01-31 09:02:11 +01:00
Igor Savin
26868f864c Fix event listener duplication (#2982)
* Fix event listener duplication. Start executing more tests in CI; fix broken test.

* Fix listener

* Fix listener

* Fix Node 6 support

* There doesn't seem to be a clear way to fix listener behaviour in Node 6, so let's just ignore it for the time being, especially considering that we are dropping support for Node 6 in April anyway.

* Update migration guide
2019-01-31 07:23:05 +02:00
Mikael Lepistö
8fe575e0f7 Updated next realease guide how to run tests 2019-01-31 05:41:42 +02:00
Mikael Lepistö
778c6a63d7 Updates for 0.16.4-next1 pre-release 2019-01-31 04:53:40 +02:00
Martin Mouterde
a2b7e0e322 schemaName is missing in MigratorConfig typings (#3016)
* schemaName is missing in MigratorConfig typings

add a schemaName value to MigratorConfig.

* update MigratorConfig typings

- change type of `directory` from `string` to `string | string[]`
- add `sortDirsSeparately` as boolean optional config.
2019-01-28 19:08:23 +01:00
Felipe Menegossi
4f8cf79500 Add "constraintName" arg to TS definition (#3006)
Add constraintName optional argument to TableBuilder.primary() TypeScript definition.
Currently, if you give the second argument, TS will tell that primary() expects only 1 argument, when in fact it supports the second optional argument to define the constraint name into the database.
2019-01-22 11:12:31 +01:00
James Beavers
816695bdbf Always use well documented pg client query() config argument (#3004)
* always use well documented query config argument

* fix options typo
2019-01-19 13:26:51 +02:00
EthanHur
7b8b74dbef add .queryContext() type definition Knex.Raw (#3002) 2019-01-16 10:25:54 +01:00
EthanHur
d857872f62 typescript type support for .asCallback() (#2963) 2019-01-16 09:12:15 +02:00
jasmeeto
5bc8deebe1 Issue 2970: Add toNative() definition in typescript (#2996) 2019-01-13 17:33:00 +01:00
Demur Rumed
83fcefe4e0 Fix typings (#2960)
* Fix typings

* Fixed JoinRaw, RawQueryBuilder and RawBuilder interfaces.

* Update knex.d.ts
2019-01-04 21:49:39 +01:00
Jorge Bucaran
a3766e6229 perf: swap chalk→colorette / minimist→getopts (#2718)
* perf: replace chalk/minimist with colorette/getopts

* Use fixed versions
2018-12-30 17:25:48 +01:00
Valentin Agachi
2430ae0c54 Add verbose option to CLI commands (#2887) 2018-12-30 17:11:57 +01:00
Igor Savin
9daf7f3d09
Display name of a failed seed (#2973) 2018-12-27 18:20:13 +01:00
walkerburgin
0b26935273 Respect loadExtensions config option (#2969) 2018-12-21 03:45:53 -06:00
André Cruz
c2dff7f843 Implemented extra boolean param for rollback() (#2968)
* Implemented extra boolean param for rollback()
Extra parameter allows all migrations to be rolled back.

* Removed spurious log

* Removed stray debugger instruction

* Moved to arrow functions
2018-12-20 17:05:28 -06:00
Mikael Lepistö
2c2fe19ad8 Updated package.json for 0.16.3 0.16.3 2018-12-19 18:55:20 +02:00
Igor Savin
02e327c51d Resolve migrations and seeds relatively to knexfile directory (#2959) 2018-12-17 14:51:35 +02:00
Igor Savin
6dbe5031e9 Check for existence of global process variable (#2958) 2018-12-17 01:58:26 +02:00
Igor Savin
2d6185a066 Only load polyfills on Node 6. (#2956) 2018-12-16 20:07:36 +02:00
sgoll
8e23dcb265 Include @types/bluebird as dependency (#2949) 2018-12-11 20:13:13 -06:00
Igor Savin
ff75f1d2bd
Do not reset prior Promise overrides on knex import (#2944)
* Do not reset prior Promise overrides on knex import

* Do not leak global state outside of the test
2018-12-10 18:20:06 +02:00
Tim Griesser
ca45cd19dd v0.16.2 v0.16.2 2018-12-10 10:05:27 -05:00
Tim Griesser
8bbd102bd1 Update changelog 2018-12-10 10:03:39 -05:00
Tim Griesser
c58ca664e6 Add 'types' to the 'files' in package.json 2018-12-10 09:58:17 -05:00
Mikael Lepistö
f570f2c610 Updated package version for release of 0.16.1 0.16.1 2018-12-10 01:13:42 +02:00
Igor Savin
ac6423f3b3 Fix support for default knexfile in working dir (#2941)
* Fix support for default knexfile in working dir

* Bump version

* Remove incorrect comment
2018-12-05 09:30:55 +02:00
Mikael Lepistö
8bb0dc3191 Updated changelog and package version for 0.16.1-next1 pre-release 2018-12-04 01:12:33 +02:00
Igor Savin
1cd1f079f8
Apply postprocessing in migrations (#2934)
Apply postprocessing in migrations
2018-12-03 23:47:09 +01:00