You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Error: create table `my_table` (`column_a` varchar(10) not null, `column_b` varchar(10) not null, constraint `my_constraint` as `constraintName` primary key (`column_a`, `column_b`)) default character set utf8mb4 - You have an error in your SQL syntax; check the manual that corresponds to your MariaDB server version for the right syntax to use near 'as `constraintName` primary key (`column_a`, `column_b`)) default character s...' at line 1
If primary() is used giving constraint name as second parameter in plain string (table.primary(['column_a', 'column_b'], 'my_constraint')) this works. Though this is deprecated way of using the primary() at least based on TS typings.
This bug was introduced in knex version 1.0.3, I suspect this pr has the root cause #5017
The text was updated successfully, but these errors were encountered:
Environment
Knex version: 2.0.0
Database + version: MariaDB 10.3.34
OS: Windows 11
Bug
Using schema builder
primary()
with options object havingconstraintName
results incorrect sql.Example:
This gives error:
If
primary()
is used giving constraint name as second parameter in plain string (table.primary(['column_a', 'column_b'], 'my_constraint')
) this works. Though this is deprecated way of using theprimary()
at least based on TS typings.This bug was introduced in knex version 1.0.3, I suspect this pr has the root cause #5017
The text was updated successfully, but these errors were encountered: