49 Commits

Author SHA1 Message Date
Mr D
65086025c0 #3751: Esm interop flag (#3616) 2020-01-14 21:01:31 +01:00
yeonhoyoon
4a2fa3b6c9 Print help only when there are no arguments (#3617) 2020-01-14 20:58:28 +01:00
James George
df2ace1915 fix: prevent warning with root command (#3604) 2020-01-04 22:57:12 +01:00
Jiri Spac
e1191ce909 make sure CLI works for namespaced knex packages as well (#2539) 2019-11-25 01:44:43 +01:00
maximelkin
531714804b Use util.promisify instead of Bluebird.promisify (#3470) 2019-10-15 09:11:59 +02:00
Lorefnon
b0c0db601a Fix some issues around seed and migration generation (#3479) 2019-10-13 13:19:53 +02:00
Taras Ozarko
7fabae9f56 Migrations up/down commands: filename parameter (#3416) 2019-10-06 18:00:04 +02:00
Vithalreddy.M.B
658e612148 knex cli list all migrations with status (#3390) (#3409) 2019-08-24 12:01:12 +02:00
Ricardo Graça
9aa7085b05 Rename src directory to lib (#3338) 2019-07-10 23:48:43 +02:00
Bohdan Shulha
c6481e8c97 fix: Respect the knexfile stub option while generating a migration (#3337) 2019-07-10 21:45:47 +02:00
Felix Mosheev
8b31a43761 feat: Run specific seed file (closes #801) (#3335) 2019-07-07 11:11:39 +02:00
Vamp
2b6333249a CLI: add --stub option to migration:make (#3316) 2019-07-04 22:08:01 +02:00
Ihor Sakaylyuk
0a85331525 CLI: Fix empty --version output (#3312) 2019-06-30 18:23:50 +02:00
Igor Savin
858c7b6f1e
Fix extension resolution from env configs (#3294) 2019-06-19 01:33:16 +02:00
Igor Savin
1e950b93e4
Name Bluebird usage explicitly. Remove spread and thenReturn (#3285) 2019-06-17 02:14:17 +02:00
Igor Savin
04b12f234b
Use extension from knexfile for generating migrations unless overriden (#3282) 2019-06-14 08:44:02 +02:00
Chris Allen
a65a95bc67 Use migrations.extension from config when generating migration (#3242) 2019-06-13 23:32:03 +02:00
Igor Savin
5eaac66ea5
Merge 0.17 into master (#3277) 2019-06-11 02:05:31 +02:00
Igor Savin
c431ffc35a
Drop support for Node.js 6. Remove babel. (#3227) 2019-06-04 00:37:17 +02:00
Lee Allen
1fe5ee0ea3 Add migrate:down functionality (#3228) 2019-05-30 00:37:18 +02:00
Zachary Mott
f4593fb9b4 Allow users to specify the migrations "tableName" parameter via the CLI. (#3214) 2019-05-21 17:41:50 -07:00
Lee Allen
08478f2db9 Feature/add up for migrations (#3205)
* Add ability to run migrate:up command to only run the next migration

* Add cli test for migrate:up

* Add test for migrator

* Add stub

* Add type

* Fix wording of test
2019-05-19 04:14:52 -07:00
Lee Allen
75df3b6f7b Feature/add rollback all to cli (#3187)
* Add --all flag for rollback in cli

* Set up test for rollback --all cli migration command

* Fix test for cli migrate:rollback --all
2019-05-12 01:35:51 +02:00
Adrien Risser
08ae1ec2a6 Add error detail log to cli.js (#3149) 2019-04-28 20:41:49 +02: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
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
02e327c51d Resolve migrations and seeds relatively to knexfile directory (#2959) 2018-12-17 14:51:35 +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
Igor Savin
8dc0a716f9
Fix CWD parameter support for CLI (#2935)
* Fix cwd support for knex-cli. Add test

* Remove redundant code

* Remove commented out code
2018-12-03 23:14:34 +01:00
Igor Savin
461868b614
Fix knexfile resolution. Add missing test (#2923)
* Fix knexfile resolution. Add missing test

* Try fixing Jake test execution

* Avoid having non-test files in jake folder

* Fix test compatibility with Node 6

* Fix the fix
2018-11-22 10:19:06 +01:00
Igor Savin
887fb53929
CLI cleanup. Do not require client for creating seeds or migrations (#2905)
* Specify jakefile explicitly to ensure it being run. Do not require client when creating seeds or migrations. cli.js cleanup. Formatting

* Fix message

* Fix typo

* Ignore console rule in CLI tests

* Fix rimraf import

* Improvements after code review

* One more arrow function
2018-11-16 13:23:22 +01:00
Aurélio A. Heckert
bb5da4b200 Migrations with CLI and without knexfile (#2884)
* Migrations with CLI and without knexfile

Allows to create and run migrations.

closes #2819

* Apply tweaks to migrate without knexfile

Thanks to @kibertoad comments!
The bigger change was to remove the bash script to test knex's cli command, and replace it with a jake file. I believe this jake file may be used as a base for future cli tests.

* Replace `fs.promises` with `new Promise`
2018-11-06 11:03:18 +02:00
Tim Griesser
232fe9f151
Add Prettier (#2697)
* Add prettier
* Run files through prettier
2018-07-09 08:10:34 -04:00
P-Seebauer
15706c0d00 2351 CLI sets exit-code 1 if the command supplied was not parseable (#2358)
* CLI Sets exit code to 1 if the command wasn't parseable

* Fix color output for errors in the cli
2018-01-19 00:29:38 +02:00
Saugat Acharya
ff4f9e213b align commands description (#1857) 2017-01-11 15:02:24 +02:00
Prashant Tiwari
ba5ae37097 Support knexfile, migration and seeds in TypeScript (#1769)
* Support knexfile, migration and seeds in TypeScript

* Look for .ts seed files

* Fix linter warning for max-len

* Enforce migration scripts to return a promise

* Remove Promise.all example from stub
2016-12-01 10:32:21 +02:00
Tim Griesser
d1a55a907d Moving bin/cli outside of src to allow install from master 2016-09-13 09:31:58 -04:00
Tim Griesser
f7ad182e68 working on a lot of tooling, migration pieces 2014-05-28 22:29:34 -04:00
Tim Griesser
db2f9e7f08 merge with master 2014-04-16 02:50:19 -04:00
John BEPPU
3deef60337 added examples to help newcomers with migrations 2014-02-14 10:08:08 -08:00
Tim Griesser
4c589cc960 working on refactoring the internals 2014-02-14 12:46:13 -05:00
Ben Drucker
bcc975986f Add local install note to CLI docs 2013-12-09 09:11:28 -05:00
Tim Griesser
39ec293892 Initial version of the migration cli ready 2013-11-25 01:43:55 -05:00
Tim Griesser
f78fc3e199 continuing work on migrations cli 2013-11-25 00:55:26 -05:00
Nikhil Benesch
2f1d4e49c4 Create skeleton CLI for migrations 2013-10-28 10:06:40 -04:00
Nikhil Benesch
ebf5036713 Executabilize bin/knex
Mark as binary to be installed in package.json; set executable
permission for development convenience.
2013-10-27 22:41:23 -04:00
Tim Griesser
86a1a24a1a some work on the migration code & api 2013-10-24 21:54:35 -04:00
Tim Griesser
4df8d8b4c5 working on migration piece 2013-07-30 14:41:25 -04:00