express-rate-limit / rate-limit-postgresql

A PostgreSQL store for express-rate-limit middleware
https://www.npmjs.com/package/@acpr/rate-limit-postgresql
MIT License
10 stars 1 forks source link

Migration failing if project already have migration setup using typeorm #13

Open mickyarun opened 1 year ago

mickyarun commented 1 year ago

Description

We are already using typeorm for migration, so getting following issue while using the package

(node:8882) UnhandledPromiseRejectionWarning: Error: Migration failed. Reason: Hashes don't match for migrations '0_create-migrations-table.sql,1-init.sql,2-add-db-functions-agg.sql,3-add-db-functions-ind.sql,4-add-db-functions-sessions.sql,5-hotfix-update-constraints.sql'.
This means that the scripts have changed since it was applied.
    at /Users/arunrajkumar/Documents/code/ATOACore/node_modules/postgres-migrations/dist/migrate.js:100:27
    at processTicksAndRejections (internal/process/task_queues.js:95:5)
    at /Users/arunrajkumar/Documents/code/ATOACore/node_modules/postgres-migrations/dist/with-lock.js:25:28
    at /Users/arunrajkumar/Documents/code/ATOACore/node_modules/postgres-migrations/dist/with-connection.js:16:28
    at applyMigrations (/Users/arunrajkumar/Documents/code/ATOACore/node_modules/@acpr/rate-limit-postgresql/dist/index.cjs:78:3)
(Use `node --trace-warnings ...` to show where the warning was created)
(node:8882) UnhandledPromiseRejectionWarning: Unhandled promise rejection. This error originated either by throwing inside of an async function without a catch block, or by rejecting a promise which was not handled with .catch(). To terminate the node process on unhandled promise rejection, use the CLI flag `--unhandled-rejections=strict` (see https://nodejs.org/api/cli.html#cli_unhandled_rejections_mode). (rejection id: 3)
(node:8882) [DEP0018] DeprecationWarning: Unhandled promise rejections are deprecated. In the future, promise rejections that are not handled will terminate the Node.js process with a non-zero exit code.

Library version

1.3.1

Node version

14.9.2

Typescript version (if you are using it)

4.5.5

Module system

ESM

mickyarun commented 12 months ago

https://github.com/express-rate-limit/rate-limit-postgresql/pull/14 , handle the migration in your base project