-
Notifications
You must be signed in to change notification settings - Fork 2.1k
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 typing deferrable and withkeyName should not be in ColumnBuilder #4600
Conversation
…e chained off each other
Can you also add a test for it? |
Yeah sure |
@kibertoad I need help with writing test though. how should i write tsd test for this? Thank you |
@zeotuan I would simply invoke a builder chain that used to throw a type error in the past, in a test. Since from my understanding this particular PR adds support for this method for more different builder cases, using several different chains would be the best. |
test-tsd/tables.test-d.ts
Outdated
knexInstance.schema.createTable('testTable',(table) => { | ||
table.foreign('fkey_three').references('non_exist.id').withKeyName('non_for1').deferrable('deferred'); | ||
table.foreign('fkey_threee').references('non_exist.id').deferrable('deferred').withKeyName('non_for2'); | ||
table.integer('num').references('non_exist.id').deferrable('immediate').withKeyName('non_for3'); | ||
table.integer('num').references('non_exist.id').withKeyName('non_for4').deferrable('deferred').onDelete('CASCADE'); | ||
table.integer('num').references('non_exist.id').withKeyName('non_for5').deferrable('deferred').onDelete('CASCADE'); | ||
table.integer('num').references('id').inTable('non_exist').withKeyName('non_for6').deferrable('deferred').onDelete('CASCADE'); | ||
table.integer('num').references('id').withKeyName('non_for7').deferrable('deferred').inTable('non_exist').onDelete('CASCADE'); | ||
}) |
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.
@kibertoad test added. Should this test be here or should we add a different test file for this type of test?
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.
here is good!
@kibertoad This should be in a seperate issue but i think we only support |
Thank you! Could you create an issue for the remaining problem? |
I came across this PR: #3556. since it hasn't been actived for a long time so i want to conttinue it and also to fix my last Pull Request where i also put
deferrable
insideColumnBuilder