export const users = mysqlTable("user", {
id: varchar("id", { length: 255 }).notNull().primaryKey(),
name: varchar("name", { length: 255 }),
username: varchar("username", { length: 255 }),
email: varchar("email", { length: 255 }).notNull(),
password: varchar("password", { length: 255 }),
image: varchar("image", { length: 255 }),
institute: varchar("institute", { length: 255 }),
isSeller: boolean("isSeller").default(false),
})
export const products = mysqlTable("product", {
userId: varchar("userId", { length: 255 })
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
id: varchar("id", { length: 255 }).notNull().primaryKey(),
name: varchar("name", { length: 255 }),
description: text("description"),
price: double("price", { precision: 6, scale: 2 }),
})
export const users = mysqlTable("user", {
id: varchar("id", { length: 255 }).notNull().primaryKey(),
name: varchar("name", { length: 255 }),
username: varchar("username", { length: 255 }),
email: varchar("email", { length: 255 }).notNull(),
password: varchar("password", { length: 255 }),
image: varchar("image", { length: 255 }),
institute: varchar("institute", { length: 255 }),
isSeller: boolean("isSeller").default(false),
})
export const products = mysqlTable("product", {
userId: varchar("userId", { length: 255 })
.notNull()
.references(() => users.id, { onDelete: "cascade" }),
id: varchar("id", { length: 255 }).notNull().primaryKey(),
name: varchar("name", { length: 255 }),
description: text("description"),
price: double("price", { precision: 6, scale: 2 }),
})