knex-migrate icon indicating copy to clipboard operation
knex-migrate copied to clipboard

Typescript support

Open corysimmons opened this issue 3 years ago • 1 comments

I know this is unmaintained now but figured I'd request it anyway.

https://github.com/sheerun/knex-migrate/pull/47 tried to add support for TS but I keep getting import or export TS bugs with it.

~~Back to manually 50 migrations.~~ I just discovered knex migrate:rollback --all && knex migrate:latest to flush my db. 🤤

corysimmons avatar May 16 '21 20:05 corysimmons

@corysimmons just to clarify, the PR adds support for creating Typescript compatible migrations, not TypeScript support itself.

For typings, you can try this simplistic one. Should make Typescript behave better with it if using knex-migrate in code:

// @types/knex-migrate/index.d.ts
declare function knexMigrate(type: string, opts?: object, process?: Function): void;

declare module 'knex-migrate' {
  export default knexMigrate;
}

kurbar avatar Jun 03 '21 07:06 kurbar