diff --git a/src/schema.ts b/src/schema.ts index 74b4766..a449c23 100644 --- a/src/schema.ts +++ b/src/schema.ts @@ -1,8 +1,7 @@ import { pgTable } from "drizzle-orm/pg-core"; import * as p from "drizzle-orm/pg-core"; -import { z } from "zod" import { createInsertSchema, createSelectSchema } from "drizzle-zod"; - +import { z } from "zod"; export const UsersTable = pgTable("users", { // Unique identifier on a technical aspect. @@ -59,9 +58,8 @@ export const UsersTable = pgTable("users", { isAdmin: p.boolean("is_admin").default(false).notNull(), }); -export const UsersTableSelectSchema = createSelectSchema(UsersTable) -export const UsersTableInsertSchema = createInsertSchema(UsersTable) - +export const UsersTableSelectSchema = createSelectSchema(UsersTable); +export const UsersTableInsertSchema = createInsertSchema(UsersTable); export const ProductsTable = pgTable("products", { uuid: p.uuid("uuid").unique().primaryKey().defaultRandom().notNull(), @@ -101,7 +99,6 @@ export const ProductsTable = pgTable("products", { export const ProductsTableSelectSchema = createSelectSchema(ProductsTable); export const ProductsTableInsertSchema = createInsertSchema(ProductsTable); - export const StocksTable = pgTable("stocks", { productId: p .uuid("product_id") @@ -113,7 +110,6 @@ export const StocksTable = pgTable("stocks", { export const StocksTableSelectSchema = createSelectSchema(StocksTable); export const StocksTableInsertSchema = createInsertSchema(StocksTable); - export const CommentsTable = pgTable("comments", { productId: p .uuid("product_id") @@ -142,7 +138,6 @@ export const CommentsTable = pgTable("comments", { export const CommentsTableSelectSchema = createSelectSchema(CommentsTable); export const CommentsTableInsertSchema = createInsertSchema(CommentsTable); - export const PurchaseHistory = pgTable("purchases", { uuid: p.uuid("uuid").unique().primaryKey().defaultRandom().notNull(),