Initial commit

This commit is contained in:
Zhongwei Li
2025-11-29 18:29:10 +08:00
commit 657f1e3da3
29 changed files with 2738 additions and 0 deletions

View File

@@ -0,0 +1,28 @@
// Grey Haven Studio - Drizzle Table Template
// Copy this template for new database tables
import { pgTable, uuid, text, timestamp, boolean, index } from "drizzle-orm/pg-core";
// TODO: Update table name
export const resources = pgTable("resources", {
// Primary key
id: uuid("id").primaryKey().defaultRandom(),
// Timestamps (REQUIRED on all tables)
created_at: timestamp("created_at").defaultNow().notNull(),
updated_at: timestamp("updated_at").defaultNow().notNull().$onUpdate(() => new Date()),
// Multi-tenant (REQUIRED on all tables)
tenant_id: uuid("tenant_id").notNull(),
// TODO: Add your fields here (use snake_case!)
name: text("name").notNull(),
description: text("description"),
is_active: boolean("is_active").default(true).notNull(),
// Soft delete (optional but recommended)
deleted_at: timestamp("deleted_at"),
});
// Indexes (REQUIRED for tenant_id)
export const resourcesIndex = index("resources_tenant_id_idx").on(resources.tenant_id);