From 32f01ec05870785c95185011e9ae61d179562dd4 Mon Sep 17 00:00:00 2001 From: Mathis Date: Thu, 11 Jul 2024 13:55:02 +0200 Subject: [PATCH] fix(schema): correct order of imports and remove extra spaces This commit corrects the order of the imports in the schema file by importing 'zod' correctly. It also removes the extra unnecessary white spaces in between the lines for a cleaner code. --- src/schema.ts | 11 +++-------- 1 file changed, 3 insertions(+), 8 deletions(-) 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(),