export const recipes = createTable("recipe", {
id: int("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
name: text("name", { length: 256 }).notNull(),
description: text("description", { length: 256 }),
image: text("image", { length: 256 }),
cookingTime: int("cookingTime", { mode: "number" }),
favorite: int("favorite", { mode: "boolean" }),
createdBy: text("createdBy", { length: 255 })
.notNull()
.references(() => users.id),
createdAt: int("created_at", { mode: "timestamp" })
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: int("updatedAt", { mode: "timestamp" }),
});
export const NewRecipeSchema = createInsertSchema(recipes);
export type NewRecipe = z.infer<typeof NewRecipeSchema>;
export const recipes = createTable("recipe", {
id: int("id", { mode: "number" }).primaryKey({ autoIncrement: true }),
name: text("name", { length: 256 }).notNull(),
description: text("description", { length: 256 }),
image: text("image", { length: 256 }),
cookingTime: int("cookingTime", { mode: "number" }),
favorite: int("favorite", { mode: "boolean" }),
createdBy: text("createdBy", { length: 255 })
.notNull()
.references(() => users.id),
createdAt: int("created_at", { mode: "timestamp" })
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: int("updatedAt", { mode: "timestamp" }),
});
export const NewRecipeSchema = createInsertSchema(recipes);
export type NewRecipe = z.infer<typeof NewRecipeSchema>;