Commit graph

93 commits

Author SHA1 Message Date
github-actions[bot]
4e8ac5294d chore(release): version packages 2024-02-05 15:51:38 +01:00
61cbcbd691 fix(cli): force exiting after 10 seconds should not change the exit code
If all migrations have been run successfully we want the exit code to be 0 even though we had to force exit the process.
This is because on some platforms (e.g. Bun) all handles are not cleaned up the same as in NodeJS, so lets be forgiving.
2024-02-05 15:48:55 +01:00
github-actions[bot]
f720aae83d chore(release): version packages 2024-02-05 15:14:33 +01:00
543b7f6f77 fix(bun): import setTimeout/setInterval from "node:timers" for .unref() to correctly work 2024-02-05 15:12:30 +01:00
db656c2310 chore: enable NPM provenance 2024-02-05 15:08:47 +01:00
github-actions[bot]
ff89dd4f86 chore(release): version packages 2024-02-05 14:54:05 +01:00
ef45be9233 fix(reporters): show number of skipped migrations correctly in command output 2024-02-05 14:17:30 +01:00
0faebbe647 docs(cli): document the relative file path support for the "remove" command 2024-01-26 16:09:49 +01:00
2f6b4d23e0 fix(reporter-default): don't dim decimal points in durations in the default reporter 2024-01-26 16:09:49 +01:00
1f139fd975 feat(remove): rework the "remove" command to be more similar to "up" and "list"
The old reporter methods related to the "remove" command is not used anymore and instead the shared `onMigrationStart`, `onMigrationSuccess` and `onMigrationError` methods are used.
Some preparation has also been made to support for removing multiple migrations at once in the future, similar to how the `--from` and `--to` CLI options work for the "up" command.
2024-01-26 16:09:49 +01:00
f2d4bb346e fix(cli): make sure errors passed to the storage are serialized correctly 2024-01-26 16:09:49 +01:00
f1b9098750 fix(migrations): don't include folders when collecting migrations
It should be possible to have folders inside your migrations folder
2024-01-26 09:26:49 +01:00
9109238b86 feat(cli): improve the "up" commands --from and --to options
The given values can either be migration names or relative paths to migration files.
The given migration must exist to avoid accidentally running migrations that wasn't intended to run.
2024-01-26 09:13:03 +01:00
github-actions[bot]
986456b038 chore(release): version packages 2024-01-23 11:44:05 +01:00
b56b6daf73 fix(cli): handle migration history entries without file extensions correctly
...even when the migration file names include periods in their names.
2024-01-23 11:36:47 +01:00
github-actions[bot]
ea327bbc49 chore(release): version packages 2024-01-22 13:49:54 +01:00
121492b303 fix(cli): sort migrations lexicographically for real 2024-01-22 13:48:09 +01:00
github-actions[bot]
bddb2d6b14 chore(release): version packages 2024-01-22 11:32:48 +01:00
a4da353d5a feat(cli): add graceful process abort
Using an AbortSignal and Promise.race we abandon running migrations that take longer to complete after the process is aborted than the given abortRespite period
2024-01-22 11:30:06 +01:00
github-actions[bot]
576dfbb124 chore(release): version packages 2024-01-19 13:48:24 +01:00
98adcda37e fix(reporters): use better wording in the header in the default reporter
Also show the number of skipped migrations
2024-01-19 13:43:59 +01:00
f515c8a854 feat(cli): add --no-execution option to the "up" command
...which can be used to log manually run migrations as successful or for baselining a database.
2024-01-19 13:43:59 +01:00
e71c318ea5 test(up): structure the up tests in a better way 2024-01-19 13:43:59 +01:00
9ef0fa2776 feat(cli): add --from and --to options to limit what migrations to run 2024-01-19 13:43:59 +01:00
02c142e39a feat(up): add --limit option to limit the number of migrations to run 2024-01-19 13:43:59 +01:00
bf4d596980 fix(cli): clarify which options that takes parameters 2024-01-19 13:43:59 +01:00
github-actions[bot]
424d3e9903 chore(release): version packages 2024-01-18 15:25:51 +01:00
73a8a42e5f fix(history): support a migration history with entries without file extensions (.js is assumed in such case) 2024-01-18 15:18:35 +01:00
github-actions[bot]
114979f154 chore(release): version packages 2024-01-18 14:52:48 +01:00
dependabot[bot]
b083e88bac chore(deps): bump cosmiconfig from 8.3.6 to 9.0.0
Bumps [cosmiconfig](https://github.com/cosmiconfig/cosmiconfig) from 8.3.6 to 9.0.0.
- [Release notes](https://github.com/cosmiconfig/cosmiconfig/releases)
- [Changelog](https://github.com/cosmiconfig/cosmiconfig/blob/main/CHANGELOG.md)
- [Commits](https://github.com/cosmiconfig/cosmiconfig/compare/cosmiconfig-v8.3.6...v9.0.0)

---
updated-dependencies:
- dependency-name: cosmiconfig
  dependency-type: direct:production
  update-type: version-update:semver-major
...

Signed-off-by: dependabot[bot] <support@github.com>
2024-01-18 14:50:14 +01:00
github-actions[bot]
9130af7b12 chore(release): version packages 2024-01-18 10:50:05 +01:00
83dc618c2e fix(cli): remove --enable-source-maps flag 2024-01-18 10:46:04 +01:00
github-actions[bot]
3c54917c35 chore(release): version packages 2023-12-28 09:20:03 +01:00
9a605a85f1 feat: add support for TypeScript migration files
And add a guide to the documentation on how to set it up for NodeJS
2023-12-20 15:27:03 +01:00
github-actions[bot]
59eb90b8cb chore(release): version packages 2023-12-20 11:24:17 +01:00
9f91bdcfa0 feat(cli): add the --import option for importing modules/packages before commands are run
Can for instance be used to load environment variables using Dotenv
2023-12-20 11:08:27 +01:00
e6e4433018 feat(cli): rename extension short option from -e to -x
BREAKING CHANGE: if you've been using the `-e` short option you should change it to `-x` or use the long option name `--extension`
2023-12-20 09:27:43 +01:00
f9a16d87a1 feat: add color option to CLI and configuration file
The option is used to force enable/disable color output and is passed to the reporter which should respect it
2023-12-20 09:11:01 +01:00
7bae76f496 docs: include Deno usage instructions in the documentation 2023-12-19 15:40:05 +01:00
github-actions[bot]
e8e35215be chore(release): version packages 2023-12-19 14:51:40 +01:00
github-actions[bot]
e67ce0de1e chore(release): version packages 2023-12-19 14:41:04 +01:00
beb6cf7719 chore(deps): upgrade ansis package 2023-12-19 14:34:54 +01:00
github-actions[bot]
747f9dbddb chore(release): version packages 2023-12-19 14:09:15 +01:00
ce6946cac4 feat: support for Bun 2023-12-19 14:06:00 +01:00
17c4723bb8 feat(postgres): implement the first version of the PostgreSQL plugin 2023-12-19 13:27:57 +01:00
987374dbd5
chore(release): version packages (#43)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-15 14:43:10 +01:00
cae6d11d53
feat(types): move Emigrate types to separate package and improve types (#41)
* feat(types): move Emigrate types to separate package

Also refactor the types to use discriminating unions for easier error handling and such.
Errors passed to storage plugins should now be serialized and storage plugins are expected to return already serialized errors on failed history entries.

* fix(mysql): handle the new type changes

* fix(storage-fs): handle the new type changes

* feat(cli): better error handling and types

Adapt to the new types from the @emigrate/types package, like discriminating union types and serializing and deserializing errors
2023-12-15 13:03:35 +01:00
afe56594c5
chore(release): version packages (#40)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-15 12:55:48 +01:00
1434be5d5e
feat(reporter): print Emigrate CLI's version number and relative paths to migrations (#39)
* feat(reporter-default): print CLI version number

* feat(reporter-default): print relative paths to migrations instead of only the file names

This makes the output clickable in most shells

* feat(reporter-pino): include the Emigrate CLI version in each log
2023-12-14 13:45:02 +01:00
480796e95b
chore(release): version packages (#36)
Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
2023-12-14 13:29:02 +01:00