Can i use "uniqueIndex" for that?

Hi, I was just wondering if
export const contactToCompany = pgTable(
"ContactToCompany",
{

contactId: integer().primaryKey()
companyId: integer().primaryKey()

},

(t) => [
index("ContactToCompany_contactId_companyId").on(
t.contactId,
t.companyId,
),
unique("ContactToCompany_contactId_companyId_key").on(
t.contactId,
t.companyId,
),
],
);
export const contactToCompany = pgTable(
"ContactToCompany",
{

contactId: integer().primaryKey()
companyId: integer().primaryKey()

},

(t) => [
index("ContactToCompany_contactId_companyId").on(
t.contactId,
t.companyId,
),
unique("ContactToCompany_contactId_companyId_key").on(
t.contactId,
t.companyId,
),
],
);
can be
(t) => [
uniqueIndex("ContactToCompany_contactId_companyId").on(
t.contactId,
t.companyId,
),
],
(t) => [
uniqueIndex("ContactToCompany_contactId_companyId").on(
t.contactId,
t.companyId,
),
],
Best regards, Tristan
0 Replies
No replies yetBe the first to reply to this messageJoin
Want results from more Discord servers?
Add your server