New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
fix TypeScript migration stub after 0.95.0 changes #4366
Conversation
Release 0.95.0 changed how types have to be imported when using TypeScript. This PR fixes the migration stub so new migrations are created correctly.
|
||
<% if (d.tableName) { %> | ||
export async function up(knex: Knex): Promise<Knex.SchemaBuilder> { | ||
return knex.schema.createTable("<%= d.tableName %>", (t: Knex.AlterTableBuilder) => { | ||
return knex.schema.createTable("<%= d.tableName %>", (t) => { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there a reason why Knex.AlterTableBuilder
was removed? Is it redundant now?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, it's redundant, TypeScript infers the type which is actually Knex.CreateTableBuilder
not Knex.AlterTableBuilder
.
Release 0.95.0 changed how types have to be imported when using TypeScript. This PR fixes the migration stub so new migrations are created correctly.