ShiftyMcCool
ShiftyMcCool
DTDrizzle Team
Created by Boxer on 7/16/2023 in #help
Module '"drizzle-orm/mysql-core"' has no exported member 'unique'.ts(2305)
I'm here for the same reason in pg. Are the docs out of date? It seems that uniqueIndex exists but the docs don't use it. This syntax from the docs doesn't work, even with uniqueIndex
export const user = pgTable('user', {
id: integer('id').unique(),
});
export const user = pgTable('user', {
id: integer('id').unique(),
});
But, this does:
export const composite = pgTable('composite_example', {
id: integer('id'),
}, (t) => ({
unq: uniqueIndex().on(t.id),
}));
export const composite = pgTable('composite_example', {
id: integer('id'),
}, (t) => ({
unq: uniqueIndex().on(t.id),
}));
Hope this helps, but the docs should really be updated if this is the correct way to do it now
13 replies