From d2f8bd8dcc0c008d5cec3fbe95544d4698f9fe2d Mon Sep 17 00:00:00 2001 From: mrevanzak Date: Sun, 12 Nov 2023 18:21:26 +0700 Subject: [PATCH] feat(db): indexing sellerId on products table --- packages/db/schema/products.ts | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/packages/db/schema/products.ts b/packages/db/schema/products.ts index 6d87a2f..bebdad7 100644 --- a/packages/db/schema/products.ts +++ b/packages/db/schema/products.ts @@ -1,5 +1,5 @@ import { relations, sql } from "drizzle-orm"; -import { int, timestamp, uniqueIndex, varchar } from "drizzle-orm/mysql-core"; +import { index, int, timestamp, varchar } from "drizzle-orm/mysql-core"; import { createInsertSchema, createSelectSchema } from "drizzle-zod"; import { z } from "zod"; @@ -28,7 +28,7 @@ export const products = mySqlTable( }, (products) => { return { - sellerIdIndex: uniqueIndex("seller_id_idx").on(products.sellerId), + sellerIdIndex: index("seller_id_idx").on(products.sellerId), }; }, );