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.
This commit is contained in:
Mathis H (Avnyr) 2024-07-11 13:55:02 +02:00
parent 7ccd247e92
commit 32f01ec058
Signed by: Mathis
GPG Key ID: DD9E0666A747D126

View File

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