This commit is contained in:
admin
2026-09-03 22:02:52 +09:00
commit 659725de15
90 changed files with 2840 additions and 0 deletions
+22
View File
@@ -0,0 +1,22 @@
import { integer, sqliteTable, text } from "drizzle-orm/sqlite-core";
import { addresses } from "./addresses";
import { products } from "./products";
import { users } from "./users";
export const orders = sqliteTable("orders", {
id: text("id").primaryKey(),
orderNumber: text("order_number").notNull().unique(),
customerId: text("customer_id").notNull().references(() => users.id),
shippingAddressId: text("shipping_address_id").notNull().references(() => addresses.id),
status: text("status").notNull(),
createdAt: text("created_at").notNull(),
updatedAt: text("updated_at").notNull()
});
export const orderItems = sqliteTable("order_items", {
id: text("id").primaryKey(),
orderId: text("order_id").notNull().references(() => orders.id),
productId: text("product_id").notNull().references(() => products.id),
quantity: integer("quantity").notNull(),
unitPriceCents: integer("unit_price_cents").notNull()
});