Some checks failed
Production PR / QA Tests (pull_request) Failing after 13s
21 lines
520 B
TypeScript
21 lines
520 B
TypeScript
import { relations } from "drizzle-orm";
|
|
import { jsonb, pgTable, text, uuid } from "drizzle-orm/pg-core";
|
|
|
|
import { user } from "./auth";
|
|
|
|
export const memberData = pgTable("member_data", {
|
|
id: uuid()
|
|
.primaryKey()
|
|
.references(() => user.id, { onDelete: "cascade" }),
|
|
country: text(),
|
|
info: jsonb(),
|
|
address: jsonb(),
|
|
billing: jsonb(),
|
|
});
|
|
|
|
export const memberDataRelations = relations(memberData, ({ one }) => ({
|
|
user: one(user, {
|
|
fields: [memberData.id],
|
|
references: [user.id],
|
|
}),
|
|
}));
|