Unique constraint typescript error
i want to make unique constraint based on two columns, but i always got an error for the first column argument. anyone know how to fix this?
6 Replies
Check your imports, you might be importing
unique
from mysql-core
instead of pg-core
Thank youuu 😘
To avoid this mistake again i just set the linter rule where i get error when i import from
drizzle-orm/mysql-core
and drizzle-orm/sqlite-core
Oh, very nice! Mind if I ask how you implemented that lint rule? Drizzle as an ESLint plugin and what you describe could be a nice addition
sorry for the late response, i don't use discord that much. there is an eslint rule where you can restrict specific import called
no-restricted-imports
.
Oh, didn't know this was a rule, very nice. Thanks for sharing