jacin
jacin
Explore posts from servers
DTDrizzle Team
Created by jacin on 8/8/2024 in #help
How to add a unique for a combination?
This is my access schema:
export const access = pgTable("access", {
id: text("id").primaryKey(),
role: roles("role").default("member"),
createdAt: timestamp("created_at", {
withTimezone: true,
mode: "date",
})
.defaultNow()
.notNull(),
organizationId: text("organization_id").references(() => organization.id),
userId: text("user_id").references(() => user.id),

});
export const access = pgTable("access", {
id: text("id").primaryKey(),
role: roles("role").default("member"),
createdAt: timestamp("created_at", {
withTimezone: true,
mode: "date",
})
.defaultNow()
.notNull(),
organizationId: text("organization_id").references(() => organization.id),
userId: text("user_id").references(() => user.id),

});
The combination of organizationId and userId must be unique. But only the combination. How can I achieve that? I'm using Postgresql. Thank you so much.
3 replies
TtRPC
Created by jacin on 7/30/2024 in #❓-help
How to try a Post request?
TIL I can't use Postman to try Post requests due to how tRPC handles requests. What can I use? Is there a simple way? Is there a client similar to Postman with a tRCP extension? Thank you so much
4 replies