Closed peterfargo2 closed 2 years ago
@peterfargo2 hi! thank you for submitting this ticket. We gonna try to improve it as it makes sense. As a quick workaround you can try to just provide Infinity
to count and this will be the same behavior as the usual default one.
I am not sure if I am correct with my assumptions, but I am not sure where else to ask. When I want to provide a migrationRunner method that runs all necessary migrations without me knowing the count, would I just not provide a count value?
For example this runs all of the extra migrations I have just fine with count not provided.
Is this the correct way of handling migrations when I am not sure of how many need to be ran?
If so, I currently get the error
[COMPILER] src/db/migration-runner.ts(7,11): error TS2322: Type '{ direction: "up"; dbClient: Client; dir: string; migrationsTable: string; }' is not assignable to type 'RunnerOption'. [COMPILER] Type '{ direction: "up"; dbClient: Client; dir: string; migrationsTable: string; }' is not assignable to type. 'RunnerOptionConfig & RunnerOptionClient'. [COMPILER] Property 'count' is missing in type '{ direction: "up"; dbClient: Client; dir: string; migrationsTable: string; }' but required in type 'RunnerOptionConfig'.
So when looking at the type I see that count is not optional
export interface RunnerOptionConfig { migrationsTable: string; migrationsSchema?: string; schema?: string | string[]; dir: string; checkOrder?: boolean; direction: MigrationDirection; count: number; timestamp?: boolean; ignorePattern?: string; file?: string; dryRun?: boolean; createSchema?: boolean; createMigrationsSchema?: boolean; singleTransaction?: boolean; noLock?: boolean; fake?: boolean; decamelize?: boolean; log?: LogFn; logger?: Logger; verbose?: boolean; }
Thanks for creating an awesome package!