Skip to content
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

mssql: Support table.primary, table.unique variant with options object #4710

Conversation

jeremy-w
Copy link
Contributor

@jeremy-w jeremy-w commented Oct 8, 2021

Before, the mssql driver only supported table.primary(cols, 'literalString'), and likewise for table.unique. But the TypeScript types have that variant marked deprecated, which pushed you to try to write table.primary(cols, {constraintName: 'literalString'}) / table.unique(cols, {indexName: 'literalString'}), which promptly failed at runtime.

Now, both variants work. If a deferrable configuration is provided other than 'not deferred', a warning will be omitted, but schema building will proceed.

@jeremy-w jeremy-w force-pushed the jsherman/mssql/fix-pk-constraint-name-generation branch from 624b38a to 3e006ea Compare October 8, 2021 01:59
@jeremy-w
Copy link
Contributor Author

jeremy-w commented Oct 8, 2021

Apparently mysql & sqlite3 also were not updated to cope with the non-deprecated flavor. 🤔

@jeremy-w jeremy-w force-pushed the jsherman/mssql/fix-pk-constraint-name-generation branch from 3e006ea to e0d5b7b Compare October 8, 2021 02:37
@kibertoad kibertoad merged commit 99e6726 into knex:master Oct 10, 2021
@kibertoad
Copy link
Collaborator

Thank you!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants