export const bookings = createTable(
"bookings",
{
id: varchar("id", { length: 36 }).primaryKey(),
locationId: varchar("location_id", { length: 36 }).notNull(),
customerName: varchar("customer_name", { length: 256 }).notNull(),
customerEmail: varchar("customer_email", { length: 256 }).notNull(),
customerPhone: varchar("customer_phone", { length: 50 }).notNull(),
startTime: datetime("start_time").notNull(),
endTime: datetime("end_time").notNull(),
totalCost: decimal("total_cost", { precision: 10, scale: 2 }),
taxAmount: decimal("tax_amount", { precision: 10, scale: 2 }),
status: varchar("status", { length: 50 }),
createdAt: timestamp("created_at")
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: timestamp("updated_at").onUpdateNow(),
},
(table) => ({
locationIdIdx: index("location_id_idx").on(table.locationId),
}),
);
export const bookings = createTable(
"bookings",
{
id: varchar("id", { length: 36 }).primaryKey(),
locationId: varchar("location_id", { length: 36 }).notNull(),
customerName: varchar("customer_name", { length: 256 }).notNull(),
customerEmail: varchar("customer_email", { length: 256 }).notNull(),
customerPhone: varchar("customer_phone", { length: 50 }).notNull(),
startTime: datetime("start_time").notNull(),
endTime: datetime("end_time").notNull(),
totalCost: decimal("total_cost", { precision: 10, scale: 2 }),
taxAmount: decimal("tax_amount", { precision: 10, scale: 2 }),
status: varchar("status", { length: 50 }),
createdAt: timestamp("created_at")
.default(sql`CURRENT_TIMESTAMP`)
.notNull(),
updatedAt: timestamp("updated_at").onUpdateNow(),
},
(table) => ({
locationIdIdx: index("location_id_idx").on(table.locationId),
}),
);