Files
accounts-manager/drizzle/0000_wet_joshua_kane.sql
Your Name 891ae27689 feat: initial commit with accounts manager project structure
- TypeScript项目基础架构
- API路由和账户管理服务
- 数据库模式和迁移
- 基础配置文件和文档

🤖 Generated with [Claude Code](https://claude.ai/code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-09-23 01:42:50 +08:00

16 lines
753 B
SQL

CREATE TABLE IF NOT EXISTS "accounts" (
"id" serial PRIMARY KEY NOT NULL,
"owner_id" varchar(128) NOT NULL,
"platform" varchar(100) NOT NULL,
"custom_id" varchar(255) NOT NULL,
"data" text NOT NULL,
"status" varchar(50) NOT NULL,
"notes" text,
"locked_at" timestamp,
"created_at" timestamp DEFAULT now() NOT NULL,
"updated_at" timestamp DEFAULT now() NOT NULL
);
--> statement-breakpoint
CREATE UNIQUE INDEX IF NOT EXISTS "platform_custom_id_idx" ON "accounts" USING btree ("platform","custom_id");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "owner_id_status_idx" ON "accounts" USING btree ("owner_id","status");--> statement-breakpoint
CREATE INDEX IF NOT EXISTS "platform_owner_idx" ON "accounts" USING btree ("platform","owner_id");