and so it begins
This commit is contained in:
@@ -1,27 +1,30 @@
|
||||
import {
|
||||
boolean,
|
||||
integer,
|
||||
pgTable,
|
||||
text,
|
||||
timestamp,
|
||||
boolean,
|
||||
integer,
|
||||
} from "drizzle-orm/pg-core";
|
||||
|
||||
export const user = pgTable("user", {
|
||||
id: text("id").primaryKey(),
|
||||
name: text("name").notNull(),
|
||||
email: text("email").notNull().unique(),
|
||||
emailVerified: boolean("email_verified").notNull(),
|
||||
emailVerified: boolean("email_verified").default(false).notNull(),
|
||||
image: text("image"),
|
||||
createdAt: timestamp("created_at").notNull(),
|
||||
updatedAt: timestamp("updated_at").notNull(),
|
||||
createdAt: timestamp("created_at").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updated_at")
|
||||
.defaultNow()
|
||||
.$onUpdate(() => /* @__PURE__ */ new Date())
|
||||
.notNull(),
|
||||
username: text("username").unique(),
|
||||
displayUsername: text("display_username"),
|
||||
role: text("role"),
|
||||
banned: boolean("banned"),
|
||||
banned: boolean("banned").default(false),
|
||||
banReason: text("ban_reason"),
|
||||
banExpires: timestamp("ban_expires"),
|
||||
parentId: text("parent_id"),
|
||||
discountPercent: integer("discount_percent"),
|
||||
discount_percent: integer("discount_percent").default(0),
|
||||
});
|
||||
|
||||
export const account = pgTable("account", {
|
||||
@@ -38,8 +41,10 @@ export const account = pgTable("account", {
|
||||
refreshTokenExpiresAt: timestamp("refresh_token_expires_at"),
|
||||
scope: text("scope"),
|
||||
password: text("password"),
|
||||
createdAt: timestamp("created_at").notNull(),
|
||||
updatedAt: timestamp("updated_at").notNull(),
|
||||
createdAt: timestamp("created_at").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updated_at")
|
||||
.$onUpdate(() => /* @__PURE__ */ new Date())
|
||||
.notNull(),
|
||||
});
|
||||
|
||||
export const verification = pgTable("verification", {
|
||||
@@ -47,6 +52,9 @@ export const verification = pgTable("verification", {
|
||||
identifier: text("identifier").notNull(),
|
||||
value: text("value").notNull(),
|
||||
expiresAt: timestamp("expires_at").notNull(),
|
||||
createdAt: timestamp("created_at"),
|
||||
updatedAt: timestamp("updated_at"),
|
||||
createdAt: timestamp("created_at").defaultNow().notNull(),
|
||||
updatedAt: timestamp("updated_at")
|
||||
.defaultNow()
|
||||
.$onUpdate(() => /* @__PURE__ */ new Date())
|
||||
.notNull(),
|
||||
});
|
||||
|
||||
@@ -1,17 +1,17 @@
|
||||
import { relations } from "drizzle-orm";
|
||||
import {
|
||||
pgTable,
|
||||
serial,
|
||||
varchar,
|
||||
decimal,
|
||||
boolean,
|
||||
timestamp,
|
||||
date,
|
||||
decimal,
|
||||
integer,
|
||||
json,
|
||||
pgTable,
|
||||
serial,
|
||||
text,
|
||||
date,
|
||||
timestamp,
|
||||
varchar,
|
||||
} from "drizzle-orm/pg-core";
|
||||
import { user } from "./auth.out";
|
||||
import { relations } from "drizzle-orm";
|
||||
|
||||
export * from "./auth.out";
|
||||
|
||||
@@ -60,6 +60,21 @@ export const order = pgTable("order", {
|
||||
updatedAt: timestamp("updated_at").defaultNow(),
|
||||
});
|
||||
|
||||
export const product = pgTable("product", {
|
||||
id: serial("id").primaryKey(),
|
||||
title: varchar("title", { length: 64 }).notNull(),
|
||||
description: text("description").notNull(),
|
||||
longDescription: text("long_description").notNull(),
|
||||
price: decimal("price", { precision: 12, scale: 2 })
|
||||
.$type<string>()
|
||||
.default("0"),
|
||||
discountPrice: decimal("discount_price", { precision: 12, scale: 2 })
|
||||
.$type<string>()
|
||||
.default("0"),
|
||||
createdAt: timestamp("created_at").defaultNow(),
|
||||
updatedAt: timestamp("updated_at").defaultNow(),
|
||||
});
|
||||
|
||||
export const passengerPII = pgTable("passenger_pii", {
|
||||
id: serial("id").primaryKey(),
|
||||
firstName: varchar("first_name", { length: 64 }).notNull(),
|
||||
|
||||
Reference in New Issue
Block a user