Project import from github
This commit is contained in:
commit
0add58254d
179 changed files with 23756 additions and 0 deletions
21
shared/utils/db/schema/memberData.ts
Normal file
21
shared/utils/db/schema/memberData.ts
Normal file
|
|
@ -0,0 +1,21 @@
|
|||
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],
|
||||
}),
|
||||
}));
|
||||
Loading…
Add table
Add a link
Reference in a new issue