From f63573745396a7b962fbffb3eca4fe5053a5bf2d Mon Sep 17 00:00:00 2001 From: yuetsh <517252939@qq.com> Date: Thu, 6 Aug 2026 20:45:51 -0600 Subject: [PATCH] =?UTF-8?q?feat(=E9=98=B6=E6=AE=B51):=20drizzle=20schema?= =?UTF-8?q?=20=E4=BB=8E=E6=9C=AC=E5=9C=B0=E5=BA=93=E7=94=9F=E6=88=90?= =?UTF-8?q?=E5=B9=B6=E5=89=AA=E6=8E=89=20Django=20=E6=A1=86=E6=9E=B6?= =?UTF-8?q?=E8=A1=A8?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Co-Authored-By: Claude Opus 5 --- apps/api/drizzle.config.ts | 12 + apps/api/package.json | 20 + apps/api/src/db/0000_crazy_gateway.sql | 453 +++ apps/api/src/db/index.ts | 11 + apps/api/src/db/meta/0000_snapshot.json | 3894 +++++++++++++++++++++++ apps/api/src/db/meta/_journal.json | 13 + apps/api/src/db/relations.ts | 273 ++ apps/api/src/db/schema.ts | 652 ++++ apps/api/tsconfig.json | 4 + bun.lock | 210 +- 10 files changed, 5536 insertions(+), 6 deletions(-) create mode 100644 apps/api/drizzle.config.ts create mode 100644 apps/api/package.json create mode 100644 apps/api/src/db/0000_crazy_gateway.sql create mode 100644 apps/api/src/db/index.ts create mode 100644 apps/api/src/db/meta/0000_snapshot.json create mode 100644 apps/api/src/db/meta/_journal.json create mode 100644 apps/api/src/db/relations.ts create mode 100644 apps/api/src/db/schema.ts create mode 100644 apps/api/tsconfig.json diff --git a/apps/api/drizzle.config.ts b/apps/api/drizzle.config.ts new file mode 100644 index 0000000..b82c217 --- /dev/null +++ b/apps/api/drizzle.config.ts @@ -0,0 +1,12 @@ +import { defineConfig } from "drizzle-kit" + +export default defineConfig({ + dialect: "postgresql", + schema: "./src/db/schema.ts", + out: "./src/db", + dbCredentials: { + url: process.env.DATABASE_URL ?? "postgres://onlinejudge:onlinejudge@localhost:5433/onlinejudge", + }, + // Django 框架表不进新后端,introspect 时直接排除 + tablesFilter: ["!django_*", "!auth_*"], +}) diff --git a/apps/api/package.json b/apps/api/package.json new file mode 100644 index 0000000..f1014dc --- /dev/null +++ b/apps/api/package.json @@ -0,0 +1,20 @@ +{ + "name": "@oj2/api", + "version": "0.0.0", + "private": true, + "type": "module", + "scripts": { + "dev": "bun --watch src/index.ts", + "db:pull": "drizzle-kit pull" + }, + "dependencies": { + "@oj2/contract": "workspace:*", + "drizzle-orm": "^0.45.2", + "hono": "^4.0.0", + "postgres": "^3.4.0", + "zod": "^4.0.0" + }, + "devDependencies": { + "drizzle-kit": "^0.31.10" + } +} diff --git a/apps/api/src/db/0000_crazy_gateway.sql b/apps/api/src/db/0000_crazy_gateway.sql new file mode 100644 index 0000000..6dc477d --- /dev/null +++ b/apps/api/src/db/0000_crazy_gateway.sql @@ -0,0 +1,453 @@ +-- Current sql file was generated after introspecting the database +-- If you want to run this migration please uncomment this code before executing migrations +/* +CREATE SEQUENCE "public"."auth_group_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1;--> statement-breakpoint +CREATE SEQUENCE "public"."auth_group_permissions_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1;--> statement-breakpoint +CREATE SEQUENCE "public"."auth_permission_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1;--> statement-breakpoint +CREATE SEQUENCE "public"."django_content_type_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1;--> statement-breakpoint +CREATE SEQUENCE "public"."django_migrations_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1;--> statement-breakpoint +CREATE TABLE "ai_analysis" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "ai_analysis_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "provider" text NOT NULL, + "data" jsonb NOT NULL, + "system_prompt" text NOT NULL, + "user_prompt" text NOT NULL, + "analysis" text NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "user_id" integer NOT NULL, + "model" text NOT NULL, + "is_pinned" boolean NOT NULL +); +--> statement-breakpoint +CREATE TABLE "announcement" ( + "id" serial PRIMARY KEY NOT NULL, + "title" text NOT NULL, + "content" text NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "last_update_time" timestamp with time zone NOT NULL, + "visible" boolean NOT NULL, + "created_by_id" integer NOT NULL, + "tag" text NOT NULL, + "top" boolean NOT NULL +); +--> statement-breakpoint +CREATE TABLE "achievement" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "achievement_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "name" text NOT NULL, + "description" text NOT NULL, + "icon" text NOT NULL, + "rarity" text NOT NULL, + "hidden" boolean DEFAULT false NOT NULL, + "metric" text NOT NULL, + "operator" text NOT NULL, + "threshold" integer NOT NULL, + "visible" boolean DEFAULT true NOT NULL, + "unlock_count" integer DEFAULT 0 NOT NULL, + "order" integer DEFAULT 0 NOT NULL, + "create_time" timestamp with time zone NOT NULL +); +--> statement-breakpoint +CREATE TABLE "contest" ( + "id" serial PRIMARY KEY NOT NULL, + "title" text NOT NULL, + "description" text NOT NULL, + "password" text, + "start_time" timestamp with time zone NOT NULL, + "end_time" timestamp with time zone NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "last_update_time" timestamp with time zone NOT NULL, + "visible" boolean NOT NULL, + "created_by_id" integer NOT NULL, + "allowed_ip_ranges" jsonb NOT NULL, + "tag" text NOT NULL +); +--> statement-breakpoint +CREATE TABLE "contest_announcement" ( + "id" serial PRIMARY KEY NOT NULL, + "title" text NOT NULL, + "content" text NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "contest_id" integer NOT NULL, + "created_by_id" integer NOT NULL, + "visible" boolean NOT NULL +); +--> statement-breakpoint +CREATE TABLE "flowchart_submission" ( + "id" text PRIMARY KEY NOT NULL, + "mermaid_code" text NOT NULL, + "flowchart_data" jsonb NOT NULL, + "status" integer NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "ai_score" double precision, + "ai_grade" varchar(10), + "ai_feedback" text, + "ai_suggestions" text, + "ai_criteria_details" jsonb NOT NULL, + "ai_provider" varchar(50) NOT NULL, + "ai_model" varchar(50) NOT NULL, + "processing_time" double precision, + "evaluation_time" timestamp with time zone, + "problem_id" integer NOT NULL, + "user_id" integer NOT NULL +); +--> statement-breakpoint +CREATE TABLE "message" ( + "id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "message_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), + "message" text NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "recipient_id" integer NOT NULL, + "sender_id" integer NOT NULL, + "submission_id" text NOT NULL +); +--> statement-breakpoint +CREATE TABLE "judge_server" ( + "id" serial PRIMARY KEY NOT NULL, + "hostname" text NOT NULL, + "ip" text, + "judger_version" text NOT NULL, + "cpu_core" integer NOT NULL, + "memory_usage" double precision NOT NULL, + "cpu_usage" double precision NOT NULL, + "last_heartbeat" timestamp with time zone NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "task_number" integer NOT NULL, + "service_url" text, + "is_disabled" boolean NOT NULL +); +--> statement-breakpoint +CREATE TABLE "exercise" ( + "id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "exercise_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), + "type" varchar(16) NOT NULL, + "data" jsonb NOT NULL, + "order" integer NOT NULL, + "created_at" timestamp with time zone NOT NULL, + "tutorial_id" integer NOT NULL +); +--> statement-breakpoint +CREATE TABLE "options_sysoptions" ( + "id" serial PRIMARY KEY NOT NULL, + "key" text NOT NULL, + "value" jsonb NOT NULL, + CONSTRAINT "options_sysoptions_key_key" UNIQUE("key") +); +--> statement-breakpoint +CREATE TABLE "problemset" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "problemset_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "title" text NOT NULL, + "description" text NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "last_update_time" timestamp with time zone NOT NULL, + "visible" boolean NOT NULL, + "difficulty" text NOT NULL, + "status" text NOT NULL, + "created_by_id" integer NOT NULL, + "end_time" timestamp with time zone +); +--> statement-breakpoint +CREATE TABLE "problemset_problem" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "problemset_problem_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "order" integer NOT NULL, + "is_required" boolean NOT NULL, + "score" integer NOT NULL, + "hint" text, + "problem_id" integer NOT NULL, + "problemset_id" bigint NOT NULL, + CONSTRAINT "unique_problemset_problem" UNIQUE("problem_id","problemset_id") +); +--> statement-breakpoint +CREATE TABLE "problemset_progress" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "problemset_progress_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "join_time" timestamp with time zone NOT NULL, + "complete_time" timestamp with time zone, + "is_completed" boolean NOT NULL, + "progress_percentage" double precision NOT NULL, + "completed_problems_count" integer NOT NULL, + "total_problems_count" integer NOT NULL, + "total_score" integer NOT NULL, + "progress_detail" jsonb NOT NULL, + "problemset_id" bigint NOT NULL, + "user_id" integer NOT NULL, + CONSTRAINT "unique_problemset_progress_user" UNIQUE("problemset_id","user_id") +); +--> statement-breakpoint +CREATE TABLE "problemset_submission" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "problemset_submission_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "problem_id" integer NOT NULL, + "problemset_id" bigint NOT NULL, + "submission_id" text NOT NULL, + "user_id" integer NOT NULL +); +--> statement-breakpoint +CREATE TABLE "reaction" ( + "id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "reaction_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), + "type" varchar(20) NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "problem_id" integer NOT NULL, + "user_id" integer NOT NULL, + CONSTRAINT "reaction_problem_user_unique" UNIQUE("problem_id","user_id") +); +--> statement-breakpoint +CREATE TABLE "problem" ( + "id" serial PRIMARY KEY NOT NULL, + "title" text NOT NULL, + "description" text NOT NULL, + "input_description" text NOT NULL, + "output_description" text NOT NULL, + "samples" jsonb NOT NULL, + "test_case_id" text NOT NULL, + "test_case_score" jsonb NOT NULL, + "hint" text, + "languages" jsonb NOT NULL, + "template" jsonb NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "last_update_time" timestamp with time zone, + "time_limit" integer NOT NULL, + "memory_limit" integer NOT NULL, + "visible" boolean DEFAULT true NOT NULL, + "difficulty" text NOT NULL, + "source" text, + "submission_number" bigint DEFAULT 0 NOT NULL, + "accepted_number" bigint DEFAULT 0 NOT NULL, + "created_by_id" integer NOT NULL, + "_id" text NOT NULL, + "statistic_info" jsonb DEFAULT '{}'::jsonb NOT NULL, + "contest_id" integer, + "is_public" boolean DEFAULT false NOT NULL, + "share_submission" boolean DEFAULT false NOT NULL, + "prompt" text, + "answers" jsonb, + "allow_flowchart" boolean DEFAULT false NOT NULL, + "flowchart_data" jsonb DEFAULT '{}'::jsonb NOT NULL, + "flowchart_hint" text, + "mermaid_code" text, + "show_flowchart" boolean DEFAULT false NOT NULL, + "ast_rules" jsonb, + "sql_config" jsonb, + "sql_display" jsonb, + CONSTRAINT "unique_problem_id_contest" UNIQUE("_id","contest_id") +); +--> statement-breakpoint +CREATE TABLE "problem_tags" ( + "id" serial PRIMARY KEY NOT NULL, + "problem_id" integer NOT NULL, + "problemtag_id" integer NOT NULL, + CONSTRAINT "problem_tags_problem_id_problemtag_id_318459d1_uniq" UNIQUE("problem_id","problemtag_id") +); +--> statement-breakpoint +CREATE TABLE "problem_tag" ( + "id" serial PRIMARY KEY NOT NULL, + "name" text NOT NULL +); +--> statement-breakpoint +CREATE TABLE "submission" ( + "id" text PRIMARY KEY NOT NULL, + "contest_id" integer, + "problem_id" integer NOT NULL, + "create_time" timestamp with time zone NOT NULL, + "user_id" integer NOT NULL, + "code" text NOT NULL, + "result" integer DEFAULT 6 NOT NULL, + "info" jsonb DEFAULT '{}'::jsonb NOT NULL, + "language" text NOT NULL, + "shared" boolean DEFAULT false NOT NULL, + "statistic_info" jsonb DEFAULT '{}'::jsonb NOT NULL, + "username" text NOT NULL, + "ip" text +); +--> statement-breakpoint +CREATE TABLE "tutorial" ( + "id" integer PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "tutorial_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 2147483647 START WITH 1 CACHE 1), + "title" varchar(128) NOT NULL, + "content" text NOT NULL, + "created_at" timestamp with time zone NOT NULL, + "updated_at" timestamp with time zone NOT NULL, + "is_public" boolean NOT NULL, + "order" integer NOT NULL, + "created_by_id" integer NOT NULL, + "code" text, + "type" varchar(10) NOT NULL +); +--> statement-breakpoint +CREATE TABLE "user_stat" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "user_stat_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "metrics" jsonb DEFAULT '{}'::jsonb NOT NULL, + "update_time" timestamp with time zone NOT NULL, + "user_id" integer NOT NULL, + CONSTRAINT "user_stat_user_id_key" UNIQUE("user_id") +); +--> statement-breakpoint +CREATE TABLE "user_achievement" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "user_achievement_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "unlock_time" timestamp with time zone NOT NULL, + "backfilled" boolean DEFAULT false NOT NULL, + "notified" boolean DEFAULT false NOT NULL, + "achievement_id" bigint NOT NULL, + "user_id" integer NOT NULL, + CONSTRAINT "unique_user_achievement" UNIQUE("achievement_id","user_id") +); +--> statement-breakpoint +CREATE TABLE "user_badge" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "user_badge_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "earned_time" timestamp with time zone NOT NULL, + "badge_id" bigint NOT NULL, + "user_id" integer NOT NULL, + CONSTRAINT "unique_user_badge" UNIQUE("badge_id","user_id") +); +--> statement-breakpoint +CREATE TABLE "user_profile" ( + "id" serial PRIMARY KEY NOT NULL, + "acm_problems_status" jsonb DEFAULT '{}'::jsonb NOT NULL, + "avatar" text NOT NULL, + "blog" varchar(200), + "mood" text, + "accepted_number" integer DEFAULT 0 NOT NULL, + "submission_number" integer DEFAULT 0 NOT NULL, + "github" text, + "school" text, + "major" text, + "user_id" integer NOT NULL, + "real_name" text, + "language" text, + CONSTRAINT "user_profile_user_id_key" UNIQUE("user_id") +); +--> statement-breakpoint +CREATE TABLE "acm_contest_rank" ( + "id" serial PRIMARY KEY NOT NULL, + "submission_number" integer DEFAULT 0 NOT NULL, + "accepted_number" integer DEFAULT 0 NOT NULL, + "total_time" integer DEFAULT 0 NOT NULL, + "submission_info" jsonb DEFAULT '{}'::jsonb NOT NULL, + "contest_id" integer NOT NULL, + "user_id" integer NOT NULL, + CONSTRAINT "unique_acm_rank_user_contest" UNIQUE("contest_id","user_id") +); +--> statement-breakpoint +CREATE TABLE "user" ( + "id" serial PRIMARY KEY NOT NULL, + "password" varchar(128) NOT NULL, + "last_login" timestamp with time zone, + "username" text NOT NULL, + "email" text, + "create_time" timestamp with time zone, + "admin_type" text NOT NULL, + "auth_token" text, + "open_api" boolean DEFAULT false NOT NULL, + "open_api_appkey" text, + "is_disabled" boolean DEFAULT false NOT NULL, + "problem_permission" text NOT NULL, + "session_keys" jsonb DEFAULT '[]'::jsonb NOT NULL, + "raw_password" varchar(20), + "class_name" text, + CONSTRAINT "user_username_key" UNIQUE("username") +); +--> statement-breakpoint +CREATE TABLE "problemset_badge" ( + "id" bigint PRIMARY KEY GENERATED BY DEFAULT AS IDENTITY (sequence name "problemset_badge_id_seq" INCREMENT BY 1 MINVALUE 1 MAXVALUE 9223372036854775807 START WITH 1 CACHE 1), + "name" text NOT NULL, + "description" text NOT NULL, + "icon" text NOT NULL, + "condition_type" text NOT NULL, + "condition_value" integer NOT NULL, + "problemset_id" bigint NOT NULL +); +--> statement-breakpoint +ALTER TABLE "ai_analysis" ADD CONSTRAINT "ai_analysis_user_id_3aa23011_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "announcement" ADD CONSTRAINT "announcement_created_by_id_359ccf50_fk_user_id" FOREIGN KEY ("created_by_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "contest" ADD CONSTRAINT "contest_created_by_id_a763ca7e_fk_user_id" FOREIGN KEY ("created_by_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "contest_announcement" ADD CONSTRAINT "contest_announcement_contest_id_a8cb419f_fk_contest_id" FOREIGN KEY ("contest_id") REFERENCES "public"."contest"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "contest_announcement" ADD CONSTRAINT "contest_announcement_created_by_id_469a14ce_fk_user_id" FOREIGN KEY ("created_by_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "flowchart_submission" ADD CONSTRAINT "flowchart_submission_problem_id_8551edbf_fk_problem_id" FOREIGN KEY ("problem_id") REFERENCES "public"."problem"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "flowchart_submission" ADD CONSTRAINT "flowchart_submission_user_id_225c83e8_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "message" ADD CONSTRAINT "message_recipient_id_2aa5dd76_fk_user_id" FOREIGN KEY ("recipient_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "message" ADD CONSTRAINT "message_sender_id_a2a2e825_fk_user_id" FOREIGN KEY ("sender_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "message" ADD CONSTRAINT "message_submission_id_2fdf8a47_fk_submission_id" FOREIGN KEY ("submission_id") REFERENCES "public"."submission"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "exercise" ADD CONSTRAINT "exercise_tutorial_id_6fd04055_fk_tutorial_id" FOREIGN KEY ("tutorial_id") REFERENCES "public"."tutorial"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset" ADD CONSTRAINT "problemset_created_by_id_01b5197f_fk_user_id" FOREIGN KEY ("created_by_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset_problem" ADD CONSTRAINT "problemset_problem_problem_id_fff2d686_fk_problem_id" FOREIGN KEY ("problem_id") REFERENCES "public"."problem"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset_problem" ADD CONSTRAINT "problemset_problem_problemset_id_350d17fb_fk_problemset_id" FOREIGN KEY ("problemset_id") REFERENCES "public"."problemset"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset_progress" ADD CONSTRAINT "problemset_progress_problemset_id_20a9632e_fk_problemset_id" FOREIGN KEY ("problemset_id") REFERENCES "public"."problemset"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset_progress" ADD CONSTRAINT "problemset_progress_user_id_c8041a80_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset_submission" ADD CONSTRAINT "problemset_submission_problem_id_5629b105_fk_problem_id" FOREIGN KEY ("problem_id") REFERENCES "public"."problem"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset_submission" ADD CONSTRAINT "problemset_submission_problemset_id_85290e17_fk_problemset_id" FOREIGN KEY ("problemset_id") REFERENCES "public"."problemset"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset_submission" ADD CONSTRAINT "problemset_submission_submission_id_78e2b807_fk_submission_id" FOREIGN KEY ("submission_id") REFERENCES "public"."submission"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset_submission" ADD CONSTRAINT "problemset_submission_user_id_915fc9c6_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "reaction" ADD CONSTRAINT "reaction_problem_id_a7f3b9f3_fk_problem_id" FOREIGN KEY ("problem_id") REFERENCES "public"."problem"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "reaction" ADD CONSTRAINT "reaction_user_id_cfa7f469_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problem" ADD CONSTRAINT "problem_contest_id_328e013a_fk_contest_id" FOREIGN KEY ("contest_id") REFERENCES "public"."contest"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problem" ADD CONSTRAINT "problem_created_by_id_cb362143_fk_user_id" FOREIGN KEY ("created_by_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problem_tags" ADD CONSTRAINT "problem_tags_problem_id_866ecb8d_fk_problem_id" FOREIGN KEY ("problem_id") REFERENCES "public"."problem"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problem_tags" ADD CONSTRAINT "problem_tags_problemtag_id_72d20571_fk_problem_tag_id" FOREIGN KEY ("problemtag_id") REFERENCES "public"."problem_tag"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "submission" ADD CONSTRAINT "submission_contest_id_775716d5_fk_contest_id" FOREIGN KEY ("contest_id") REFERENCES "public"."contest"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "submission" ADD CONSTRAINT "submission_problem_id_76847b55_fk_problem_id" FOREIGN KEY ("problem_id") REFERENCES "public"."problem"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "tutorial" ADD CONSTRAINT "tutorial_created_by_id_07973cab_fk_user_id" FOREIGN KEY ("created_by_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "user_stat" ADD CONSTRAINT "user_stat_user_id_73337fc0_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "user_achievement" ADD CONSTRAINT "user_achievement_achievement_id_29db600d_fk_achievement_id" FOREIGN KEY ("achievement_id") REFERENCES "public"."achievement"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "user_achievement" ADD CONSTRAINT "user_achievement_user_id_b8ec7d6a_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "user_badge" ADD CONSTRAINT "user_badge_badge_id_92a983e9_fk_problemset_badge_id" FOREIGN KEY ("badge_id") REFERENCES "public"."problemset_badge"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "user_badge" ADD CONSTRAINT "user_badge_user_id_a286d718_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "user_profile" ADD CONSTRAINT "user_profile_user_id_8fdce8e2_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "acm_contest_rank" ADD CONSTRAINT "acm_contest_rank_contest_id_21030ccd_fk_contest_id" FOREIGN KEY ("contest_id") REFERENCES "public"."contest"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "acm_contest_rank" ADD CONSTRAINT "acm_contest_rank_user_id_40391ab2_fk_user_id" FOREIGN KEY ("user_id") REFERENCES "public"."user"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +ALTER TABLE "problemset_badge" ADD CONSTRAINT "problemset_badge_problemset_id_6cb6c74f_fk_problemset_id" FOREIGN KEY ("problemset_id") REFERENCES "public"."problemset"("id") ON DELETE no action ON UPDATE no action;--> statement-breakpoint +CREATE INDEX "ai_analysis_user_id_3aa23011" ON "ai_analysis" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "announcement_created_by_id_359ccf50" ON "announcement" USING btree ("created_by_id" int4_ops);--> statement-breakpoint +CREATE INDEX "announcement_list_idx" ON "announcement" USING btree ("visible" bool_ops,"top" bool_ops,"create_time" bool_ops);--> statement-breakpoint +CREATE INDEX "contest_created_by_id_a763ca7e" ON "contest" USING btree ("created_by_id" int4_ops);--> statement-breakpoint +CREATE INDEX "contest_announcement_contest_id_a8cb419f" ON "contest_announcement" USING btree ("contest_id" int4_ops);--> statement-breakpoint +CREATE INDEX "contest_announcement_created_by_id_469a14ce" ON "contest_announcement" USING btree ("created_by_id" int4_ops);--> statement-breakpoint +CREATE INDEX "flowchart_problem_time_idx" ON "flowchart_submission" USING btree ("problem_id" int4_ops,"create_time" int4_ops);--> statement-breakpoint +CREATE INDEX "flowchart_status_idx" ON "flowchart_submission" USING btree ("status" int4_ops);--> statement-breakpoint +CREATE INDEX "flowchart_submission_id_0dbfc4f9_like" ON "flowchart_submission" USING btree ("id" text_pattern_ops);--> statement-breakpoint +CREATE INDEX "flowchart_submission_problem_id_8551edbf" ON "flowchart_submission" USING btree ("problem_id" int4_ops);--> statement-breakpoint +CREATE INDEX "flowchart_submission_user_id_225c83e8" ON "flowchart_submission" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "flowchart_user_time_idx" ON "flowchart_submission" USING btree ("user_id" int4_ops,"create_time" int4_ops);--> statement-breakpoint +CREATE INDEX "message_recipient_id_2aa5dd76" ON "message" USING btree ("recipient_id" int4_ops);--> statement-breakpoint +CREATE INDEX "message_recipient_time_idx" ON "message" USING btree ("recipient_id" timestamptz_ops,"create_time" int4_ops);--> statement-breakpoint +CREATE INDEX "message_sender_id_a2a2e825" ON "message" USING btree ("sender_id" int4_ops);--> statement-breakpoint +CREATE INDEX "message_submission_id_2fdf8a47" ON "message" USING btree ("submission_id" text_ops);--> statement-breakpoint +CREATE INDEX "message_submission_id_2fdf8a47_like" ON "message" USING btree ("submission_id" text_pattern_ops);--> statement-breakpoint +CREATE INDEX "exercise_tutorial_id_6fd04055" ON "exercise" USING btree ("tutorial_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problemset_created_by_id_01b5197f" ON "problemset" USING btree ("created_by_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problemset_problem_problem_id_fff2d686" ON "problemset_problem" USING btree ("problem_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problemset_problem_problemset_id_350d17fb" ON "problemset_problem" USING btree ("problemset_id" int8_ops);--> statement-breakpoint +CREATE INDEX "problemset_progress_problemset_id_20a9632e" ON "problemset_progress" USING btree ("problemset_id" int8_ops);--> statement-breakpoint +CREATE INDEX "problemset_progress_user_id_c8041a80" ON "problemset_progress" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problemset__problem_1f39fa_idx" ON "problemset_submission" USING btree ("problemset_id" int4_ops,"user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problemset__problem_22f053_idx" ON "problemset_submission" USING btree ("problemset_id" int8_ops,"problem_id" int8_ops);--> statement-breakpoint +CREATE INDEX "problemset__user_id_2f1501_idx" ON "problemset_submission" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problemset_submission_problem_id_5629b105" ON "problemset_submission" USING btree ("problem_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problemset_submission_problemset_id_85290e17" ON "problemset_submission" USING btree ("problemset_id" int8_ops);--> statement-breakpoint +CREATE INDEX "problemset_submission_submission_id_78e2b807" ON "problemset_submission" USING btree ("submission_id" text_ops);--> statement-breakpoint +CREATE INDEX "problemset_submission_submission_id_78e2b807_like" ON "problemset_submission" USING btree ("submission_id" text_pattern_ops);--> statement-breakpoint +CREATE INDEX "problemset_submission_user_id_915fc9c6" ON "problemset_submission" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "reaction_problem_id_a7f3b9f3" ON "reaction" USING btree ("problem_id" int4_ops);--> statement-breakpoint +CREATE INDEX "reaction_problem_type_idx" ON "reaction" USING btree ("problem_id" int4_ops,"type" int4_ops);--> statement-breakpoint +CREATE INDEX "reaction_user_id_cfa7f469" ON "reaction" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problem__id_919b1d80" ON "problem" USING btree ("_id" text_ops);--> statement-breakpoint +CREATE INDEX "problem_contest_id_328e013a" ON "problem" USING btree ("contest_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problem_contest_visible_idx" ON "problem" USING btree ("contest_id" bool_ops,"visible" int4_ops);--> statement-breakpoint +CREATE INDEX "problem_created_by_id_cb362143" ON "problem" USING btree ("created_by_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problem_visible_idx" ON "problem" USING btree ("visible" bool_ops);--> statement-breakpoint +CREATE INDEX "problem_tags_problem_id_866ecb8d" ON "problem_tags" USING btree ("problem_id" int4_ops);--> statement-breakpoint +CREATE INDEX "problem_tags_problemtag_id_72d20571" ON "problem_tags" USING btree ("problemtag_id" int4_ops);--> statement-breakpoint +CREATE UNIQUE INDEX "problem_tag_name_ci_unique" ON "problem_tag" USING btree (lower(name) text_ops);--> statement-breakpoint +CREATE INDEX "contest_create_time_idx" ON "submission" USING btree ("contest_id" timestamptz_ops,"create_time" int4_ops);--> statement-breakpoint +CREATE INDEX "problem_user_idx" ON "submission" USING btree ("problem_id" int4_ops,"user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "submission_contest_id_775716d5" ON "submission" USING btree ("contest_id" int4_ops);--> statement-breakpoint +CREATE INDEX "submission_problem_id_76847b55" ON "submission" USING btree ("problem_id" int4_ops);--> statement-breakpoint +CREATE INDEX "submission_result_37e2f67a" ON "submission" USING btree ("result" int4_ops);--> statement-breakpoint +CREATE INDEX "submission_user_id_3779a8c1" ON "submission" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "user_create_time_idx" ON "submission" USING btree ("user_id" int4_ops,"create_time" timestamptz_ops);--> statement-breakpoint +CREATE INDEX "tutorial_created_by_id_07973cab" ON "tutorial" USING btree ("created_by_id" int4_ops);--> statement-breakpoint +CREATE INDEX "user_achievement_achievement_id_29db600d" ON "user_achievement" USING btree ("achievement_id" int8_ops);--> statement-breakpoint +CREATE INDEX "user_achievement_user_id_b8ec7d6a" ON "user_achievement" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "user_achv_notified_idx" ON "user_achievement" USING btree ("user_id" int4_ops,"notified" bool_ops);--> statement-breakpoint +CREATE INDEX "user_achv_time_idx" ON "user_achievement" USING btree ("user_id" int4_ops,"unlock_time" timestamptz_ops);--> statement-breakpoint +CREATE INDEX "user_badge_badge_id_92a983e9" ON "user_badge" USING btree ("badge_id" int8_ops);--> statement-breakpoint +CREATE INDEX "user_badge_user_id_a286d718" ON "user_badge" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "acm_contest_rank_contest_id_21030ccd" ON "acm_contest_rank" USING btree ("contest_id" int4_ops);--> statement-breakpoint +CREATE INDEX "acm_contest_rank_user_id_40391ab2" ON "acm_contest_rank" USING btree ("user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "acm_rank_contest_user_idx" ON "acm_contest_rank" USING btree ("contest_id" int4_ops,"user_id" int4_ops);--> statement-breakpoint +CREATE INDEX "acm_rank_order_idx" ON "acm_contest_rank" USING btree ("contest_id" int4_ops,"accepted_number" int4_ops,"total_time" int4_ops);--> statement-breakpoint +CREATE INDEX "problemset_badge_problemset_id_6cb6c74f" ON "problemset_badge" USING btree ("problemset_id" int8_ops); +*/ \ No newline at end of file diff --git a/apps/api/src/db/index.ts b/apps/api/src/db/index.ts new file mode 100644 index 0000000..90e40da --- /dev/null +++ b/apps/api/src/db/index.ts @@ -0,0 +1,11 @@ +import { drizzle } from "drizzle-orm/postgres-js" +import postgres from "postgres" + +import * as schema from "./schema" + +const url = process.env.DATABASE_URL ?? "postgres://onlinejudge:onlinejudge@localhost:5433/onlinejudge" + +const client = postgres(url) + +export const db = drizzle(client, { schema }) +export { schema } diff --git a/apps/api/src/db/meta/0000_snapshot.json b/apps/api/src/db/meta/0000_snapshot.json new file mode 100644 index 0000000..e898a8b --- /dev/null +++ b/apps/api/src/db/meta/0000_snapshot.json @@ -0,0 +1,3894 @@ +{ + "id": "00000000-0000-0000-0000-000000000000", + "prevId": "", + "version": "7", + "dialect": "postgresql", + "tables": { + "public.ai_analysis": { + "name": "ai_analysis", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "ai_analysis_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "provider": { + "name": "provider", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "system_prompt": { + "name": "system_prompt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_prompt": { + "name": "user_prompt", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "analysis": { + "name": "analysis", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "model": { + "name": "model", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "is_pinned": { + "name": "is_pinned", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "ai_analysis_user_id_3aa23011": { + "name": "ai_analysis_user_id_3aa23011", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "ai_analysis_user_id_3aa23011_fk_user_id": { + "name": "ai_analysis_user_id_3aa23011_fk_user_id", + "tableFrom": "ai_analysis", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.announcement": { + "name": "announcement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_update_time": { + "name": "last_update_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "visible": { + "name": "visible", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "created_by_id": { + "name": "created_by_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "top": { + "name": "top", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "announcement_created_by_id_359ccf50": { + "name": "announcement_created_by_id_359ccf50", + "columns": [ + { + "expression": "created_by_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "announcement_list_idx": { + "name": "announcement_list_idx", + "columns": [ + { + "expression": "visible", + "asc": true, + "nulls": "last", + "opclass": "bool_ops", + "isExpression": false + }, + { + "expression": "top", + "asc": false, + "nulls": "first", + "opclass": "bool_ops", + "isExpression": false + }, + { + "expression": "create_time", + "asc": false, + "nulls": "first", + "opclass": "bool_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "announcement_created_by_id_359ccf50_fk_user_id": { + "name": "announcement_created_by_id_359ccf50_fk_user_id", + "tableFrom": "announcement", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.achievement": { + "name": "achievement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "achievement_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "rarity": { + "name": "rarity", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "hidden": { + "name": "hidden", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "metric": { + "name": "metric", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "operator": { + "name": "operator", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "threshold": { + "name": "threshold", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "visible": { + "name": "visible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "unlock_count": { + "name": "unlock_count", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.contest": { + "name": "contest", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "password": { + "name": "password", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "start_time": { + "name": "start_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_update_time": { + "name": "last_update_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "visible": { + "name": "visible", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "created_by_id": { + "name": "created_by_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "allowed_ip_ranges": { + "name": "allowed_ip_ranges", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "tag": { + "name": "tag", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "contest_created_by_id_a763ca7e": { + "name": "contest_created_by_id_a763ca7e", + "columns": [ + { + "expression": "created_by_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "contest_created_by_id_a763ca7e_fk_user_id": { + "name": "contest_created_by_id_a763ca7e_fk_user_id", + "tableFrom": "contest", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.contest_announcement": { + "name": "contest_announcement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "contest_id": { + "name": "contest_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_by_id": { + "name": "created_by_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "visible": { + "name": "visible", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "contest_announcement_contest_id_a8cb419f": { + "name": "contest_announcement_contest_id_a8cb419f", + "columns": [ + { + "expression": "contest_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "contest_announcement_created_by_id_469a14ce": { + "name": "contest_announcement_created_by_id_469a14ce", + "columns": [ + { + "expression": "created_by_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "contest_announcement_contest_id_a8cb419f_fk_contest_id": { + "name": "contest_announcement_contest_id_a8cb419f_fk_contest_id", + "tableFrom": "contest_announcement", + "tableTo": "contest", + "schemaTo": "public", + "columnsFrom": [ + "contest_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "contest_announcement_created_by_id_469a14ce_fk_user_id": { + "name": "contest_announcement_created_by_id_469a14ce_fk_user_id", + "tableFrom": "contest_announcement", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.flowchart_submission": { + "name": "flowchart_submission", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "mermaid_code": { + "name": "mermaid_code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "flowchart_data": { + "name": "flowchart_data", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "ai_score": { + "name": "ai_score", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "ai_grade": { + "name": "ai_grade", + "type": "varchar(10)", + "primaryKey": false, + "notNull": false + }, + "ai_feedback": { + "name": "ai_feedback", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ai_suggestions": { + "name": "ai_suggestions", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "ai_criteria_details": { + "name": "ai_criteria_details", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "ai_provider": { + "name": "ai_provider", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "ai_model": { + "name": "ai_model", + "type": "varchar(50)", + "primaryKey": false, + "notNull": true + }, + "processing_time": { + "name": "processing_time", + "type": "double precision", + "primaryKey": false, + "notNull": false + }, + "evaluation_time": { + "name": "evaluation_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "problem_id": { + "name": "problem_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "flowchart_problem_time_idx": { + "name": "flowchart_problem_time_idx", + "columns": [ + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "create_time", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "flowchart_status_idx": { + "name": "flowchart_status_idx", + "columns": [ + { + "expression": "status", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "flowchart_submission_id_0dbfc4f9_like": { + "name": "flowchart_submission_id_0dbfc4f9_like", + "columns": [ + { + "expression": "id", + "asc": true, + "nulls": "last", + "opclass": "text_pattern_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "flowchart_submission_problem_id_8551edbf": { + "name": "flowchart_submission_problem_id_8551edbf", + "columns": [ + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "flowchart_submission_user_id_225c83e8": { + "name": "flowchart_submission_user_id_225c83e8", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "flowchart_user_time_idx": { + "name": "flowchart_user_time_idx", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "create_time", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "flowchart_submission_problem_id_8551edbf_fk_problem_id": { + "name": "flowchart_submission_problem_id_8551edbf_fk_problem_id", + "tableFrom": "flowchart_submission", + "tableTo": "problem", + "schemaTo": "public", + "columnsFrom": [ + "problem_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "flowchart_submission_user_id_225c83e8_fk_user_id": { + "name": "flowchart_submission_user_id_225c83e8_fk_user_id", + "tableFrom": "flowchart_submission", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.message": { + "name": "message", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "message_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "2147483647", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "message": { + "name": "message", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "recipient_id": { + "name": "recipient_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "sender_id": { + "name": "sender_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "submission_id": { + "name": "submission_id", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "message_recipient_id_2aa5dd76": { + "name": "message_recipient_id_2aa5dd76", + "columns": [ + { + "expression": "recipient_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "message_recipient_time_idx": { + "name": "message_recipient_time_idx", + "columns": [ + { + "expression": "recipient_id", + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops", + "isExpression": false + }, + { + "expression": "create_time", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "message_sender_id_a2a2e825": { + "name": "message_sender_id_a2a2e825", + "columns": [ + { + "expression": "sender_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "message_submission_id_2fdf8a47": { + "name": "message_submission_id_2fdf8a47", + "columns": [ + { + "expression": "submission_id", + "asc": true, + "nulls": "last", + "opclass": "text_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "message_submission_id_2fdf8a47_like": { + "name": "message_submission_id_2fdf8a47_like", + "columns": [ + { + "expression": "submission_id", + "asc": true, + "nulls": "last", + "opclass": "text_pattern_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "message_recipient_id_2aa5dd76_fk_user_id": { + "name": "message_recipient_id_2aa5dd76_fk_user_id", + "tableFrom": "message", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "recipient_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "message_sender_id_a2a2e825_fk_user_id": { + "name": "message_sender_id_a2a2e825_fk_user_id", + "tableFrom": "message", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "sender_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "message_submission_id_2fdf8a47_fk_submission_id": { + "name": "message_submission_id_2fdf8a47_fk_submission_id", + "tableFrom": "message", + "tableTo": "submission", + "schemaTo": "public", + "columnsFrom": [ + "submission_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.judge_server": { + "name": "judge_server", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "hostname": { + "name": "hostname", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "judger_version": { + "name": "judger_version", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "cpu_core": { + "name": "cpu_core", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "memory_usage": { + "name": "memory_usage", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "cpu_usage": { + "name": "cpu_usage", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "last_heartbeat": { + "name": "last_heartbeat", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "task_number": { + "name": "task_number", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "service_url": { + "name": "service_url", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_disabled": { + "name": "is_disabled", + "type": "boolean", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.exercise": { + "name": "exercise", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "exercise_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "2147483647", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "type": { + "name": "type", + "type": "varchar(16)", + "primaryKey": false, + "notNull": true + }, + "data": { + "name": "data", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "tutorial_id": { + "name": "tutorial_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "exercise_tutorial_id_6fd04055": { + "name": "exercise_tutorial_id_6fd04055", + "columns": [ + { + "expression": "tutorial_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "exercise_tutorial_id_6fd04055_fk_tutorial_id": { + "name": "exercise_tutorial_id_6fd04055_fk_tutorial_id", + "tableFrom": "exercise", + "tableTo": "tutorial", + "schemaTo": "public", + "columnsFrom": [ + "tutorial_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.options_sysoptions": { + "name": "options_sysoptions", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "key": { + "name": "key", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "value": { + "name": "value", + "type": "jsonb", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "options_sysoptions_key_key": { + "columns": [ + "key" + ], + "nullsNotDistinct": false, + "name": "options_sysoptions_key_key" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.problemset": { + "name": "problemset", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "problemset_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_update_time": { + "name": "last_update_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "visible": { + "name": "visible", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "difficulty": { + "name": "difficulty", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "status": { + "name": "status", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_by_id": { + "name": "created_by_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "end_time": { + "name": "end_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "problemset_created_by_id_01b5197f": { + "name": "problemset_created_by_id_01b5197f", + "columns": [ + { + "expression": "created_by_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "problemset_created_by_id_01b5197f_fk_user_id": { + "name": "problemset_created_by_id_01b5197f_fk_user_id", + "tableFrom": "problemset", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.problemset_problem": { + "name": "problemset_problem", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "problemset_problem_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "is_required": { + "name": "is_required", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "score": { + "name": "score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "hint": { + "name": "hint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "problem_id": { + "name": "problem_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "problemset_id": { + "name": "problemset_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "problemset_problem_problem_id_fff2d686": { + "name": "problemset_problem_problem_id_fff2d686", + "columns": [ + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problemset_problem_problemset_id_350d17fb": { + "name": "problemset_problem_problemset_id_350d17fb", + "columns": [ + { + "expression": "problemset_id", + "asc": true, + "nulls": "last", + "opclass": "int8_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "problemset_problem_problem_id_fff2d686_fk_problem_id": { + "name": "problemset_problem_problem_id_fff2d686_fk_problem_id", + "tableFrom": "problemset_problem", + "tableTo": "problem", + "schemaTo": "public", + "columnsFrom": [ + "problem_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "problemset_problem_problemset_id_350d17fb_fk_problemset_id": { + "name": "problemset_problem_problemset_id_350d17fb_fk_problemset_id", + "tableFrom": "problemset_problem", + "tableTo": "problemset", + "schemaTo": "public", + "columnsFrom": [ + "problemset_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "unique_problemset_problem": { + "columns": [ + "problem_id", + "problemset_id" + ], + "nullsNotDistinct": false, + "name": "unique_problemset_problem" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.problemset_progress": { + "name": "problemset_progress", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "problemset_progress_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "join_time": { + "name": "join_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "complete_time": { + "name": "complete_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "is_completed": { + "name": "is_completed", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "progress_percentage": { + "name": "progress_percentage", + "type": "double precision", + "primaryKey": false, + "notNull": true + }, + "completed_problems_count": { + "name": "completed_problems_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "total_problems_count": { + "name": "total_problems_count", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "total_score": { + "name": "total_score", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "progress_detail": { + "name": "progress_detail", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "problemset_id": { + "name": "problemset_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "problemset_progress_problemset_id_20a9632e": { + "name": "problemset_progress_problemset_id_20a9632e", + "columns": [ + { + "expression": "problemset_id", + "asc": true, + "nulls": "last", + "opclass": "int8_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problemset_progress_user_id_c8041a80": { + "name": "problemset_progress_user_id_c8041a80", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "problemset_progress_problemset_id_20a9632e_fk_problemset_id": { + "name": "problemset_progress_problemset_id_20a9632e_fk_problemset_id", + "tableFrom": "problemset_progress", + "tableTo": "problemset", + "schemaTo": "public", + "columnsFrom": [ + "problemset_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "problemset_progress_user_id_c8041a80_fk_user_id": { + "name": "problemset_progress_user_id_c8041a80_fk_user_id", + "tableFrom": "problemset_progress", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "unique_problemset_progress_user": { + "columns": [ + "problemset_id", + "user_id" + ], + "nullsNotDistinct": false, + "name": "unique_problemset_progress_user" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.problemset_submission": { + "name": "problemset_submission", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "problemset_submission_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "problem_id": { + "name": "problem_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "problemset_id": { + "name": "problemset_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "submission_id": { + "name": "submission_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "problemset__problem_1f39fa_idx": { + "name": "problemset__problem_1f39fa_idx", + "columns": [ + { + "expression": "problemset_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problemset__problem_22f053_idx": { + "name": "problemset__problem_22f053_idx", + "columns": [ + { + "expression": "problemset_id", + "asc": true, + "nulls": "last", + "opclass": "int8_ops", + "isExpression": false + }, + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int8_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problemset__user_id_2f1501_idx": { + "name": "problemset__user_id_2f1501_idx", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problemset_submission_problem_id_5629b105": { + "name": "problemset_submission_problem_id_5629b105", + "columns": [ + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problemset_submission_problemset_id_85290e17": { + "name": "problemset_submission_problemset_id_85290e17", + "columns": [ + { + "expression": "problemset_id", + "asc": true, + "nulls": "last", + "opclass": "int8_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problemset_submission_submission_id_78e2b807": { + "name": "problemset_submission_submission_id_78e2b807", + "columns": [ + { + "expression": "submission_id", + "asc": true, + "nulls": "last", + "opclass": "text_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problemset_submission_submission_id_78e2b807_like": { + "name": "problemset_submission_submission_id_78e2b807_like", + "columns": [ + { + "expression": "submission_id", + "asc": true, + "nulls": "last", + "opclass": "text_pattern_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problemset_submission_user_id_915fc9c6": { + "name": "problemset_submission_user_id_915fc9c6", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "problemset_submission_problem_id_5629b105_fk_problem_id": { + "name": "problemset_submission_problem_id_5629b105_fk_problem_id", + "tableFrom": "problemset_submission", + "tableTo": "problem", + "schemaTo": "public", + "columnsFrom": [ + "problem_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "problemset_submission_problemset_id_85290e17_fk_problemset_id": { + "name": "problemset_submission_problemset_id_85290e17_fk_problemset_id", + "tableFrom": "problemset_submission", + "tableTo": "problemset", + "schemaTo": "public", + "columnsFrom": [ + "problemset_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "problemset_submission_submission_id_78e2b807_fk_submission_id": { + "name": "problemset_submission_submission_id_78e2b807_fk_submission_id", + "tableFrom": "problemset_submission", + "tableTo": "submission", + "schemaTo": "public", + "columnsFrom": [ + "submission_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "problemset_submission_user_id_915fc9c6_fk_user_id": { + "name": "problemset_submission_user_id_915fc9c6_fk_user_id", + "tableFrom": "problemset_submission", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.reaction": { + "name": "reaction", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "reaction_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "2147483647", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "type": { + "name": "type", + "type": "varchar(20)", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "problem_id": { + "name": "problem_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "reaction_problem_id_a7f3b9f3": { + "name": "reaction_problem_id_a7f3b9f3", + "columns": [ + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "reaction_problem_type_idx": { + "name": "reaction_problem_type_idx", + "columns": [ + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "type", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "reaction_user_id_cfa7f469": { + "name": "reaction_user_id_cfa7f469", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "reaction_problem_id_a7f3b9f3_fk_problem_id": { + "name": "reaction_problem_id_a7f3b9f3_fk_problem_id", + "tableFrom": "reaction", + "tableTo": "problem", + "schemaTo": "public", + "columnsFrom": [ + "problem_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "reaction_user_id_cfa7f469_fk_user_id": { + "name": "reaction_user_id_cfa7f469_fk_user_id", + "tableFrom": "reaction", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "reaction_problem_user_unique": { + "columns": [ + "problem_id", + "user_id" + ], + "nullsNotDistinct": false, + "name": "reaction_problem_user_unique" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.problem": { + "name": "problem", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "title": { + "name": "title", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "input_description": { + "name": "input_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "output_description": { + "name": "output_description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "samples": { + "name": "samples", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "test_case_id": { + "name": "test_case_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "test_case_score": { + "name": "test_case_score", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "hint": { + "name": "hint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "languages": { + "name": "languages", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "template": { + "name": "template", + "type": "jsonb", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "last_update_time": { + "name": "last_update_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "time_limit": { + "name": "time_limit", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "memory_limit": { + "name": "memory_limit", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "visible": { + "name": "visible", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": true + }, + "difficulty": { + "name": "difficulty", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "source": { + "name": "source", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "submission_number": { + "name": "submission_number", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "accepted_number": { + "name": "accepted_number", + "type": "bigint", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "created_by_id": { + "name": "created_by_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "_id": { + "name": "_id", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "statistic_info": { + "name": "statistic_info", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "contest_id": { + "name": "contest_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "is_public": { + "name": "is_public", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "share_submission": { + "name": "share_submission", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "prompt": { + "name": "prompt", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "answers": { + "name": "answers", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "allow_flowchart": { + "name": "allow_flowchart", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "flowchart_data": { + "name": "flowchart_data", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "flowchart_hint": { + "name": "flowchart_hint", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "mermaid_code": { + "name": "mermaid_code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "show_flowchart": { + "name": "show_flowchart", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "ast_rules": { + "name": "ast_rules", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "sql_config": { + "name": "sql_config", + "type": "jsonb", + "primaryKey": false, + "notNull": false + }, + "sql_display": { + "name": "sql_display", + "type": "jsonb", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "problem__id_919b1d80": { + "name": "problem__id_919b1d80", + "columns": [ + { + "expression": "_id", + "asc": true, + "nulls": "last", + "opclass": "text_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problem_contest_id_328e013a": { + "name": "problem_contest_id_328e013a", + "columns": [ + { + "expression": "contest_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problem_contest_visible_idx": { + "name": "problem_contest_visible_idx", + "columns": [ + { + "expression": "contest_id", + "asc": true, + "nulls": "last", + "opclass": "bool_ops", + "isExpression": false + }, + { + "expression": "visible", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problem_created_by_id_cb362143": { + "name": "problem_created_by_id_cb362143", + "columns": [ + { + "expression": "created_by_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problem_visible_idx": { + "name": "problem_visible_idx", + "columns": [ + { + "expression": "visible", + "asc": true, + "nulls": "last", + "opclass": "bool_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "problem_contest_id_328e013a_fk_contest_id": { + "name": "problem_contest_id_328e013a_fk_contest_id", + "tableFrom": "problem", + "tableTo": "contest", + "schemaTo": "public", + "columnsFrom": [ + "contest_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "problem_created_by_id_cb362143_fk_user_id": { + "name": "problem_created_by_id_cb362143_fk_user_id", + "tableFrom": "problem", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "unique_problem_id_contest": { + "columns": [ + "_id", + "contest_id" + ], + "nullsNotDistinct": false, + "name": "unique_problem_id_contest" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.problem_tags": { + "name": "problem_tags", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "problem_id": { + "name": "problem_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "problemtag_id": { + "name": "problemtag_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "problem_tags_problem_id_866ecb8d": { + "name": "problem_tags_problem_id_866ecb8d", + "columns": [ + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problem_tags_problemtag_id_72d20571": { + "name": "problem_tags_problemtag_id_72d20571", + "columns": [ + { + "expression": "problemtag_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "problem_tags_problem_id_866ecb8d_fk_problem_id": { + "name": "problem_tags_problem_id_866ecb8d_fk_problem_id", + "tableFrom": "problem_tags", + "tableTo": "problem", + "schemaTo": "public", + "columnsFrom": [ + "problem_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "problem_tags_problemtag_id_72d20571_fk_problem_tag_id": { + "name": "problem_tags_problemtag_id_72d20571_fk_problem_tag_id", + "tableFrom": "problem_tags", + "tableTo": "problem_tag", + "schemaTo": "public", + "columnsFrom": [ + "problemtag_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "problem_tags_problem_id_problemtag_id_318459d1_uniq": { + "columns": [ + "problem_id", + "problemtag_id" + ], + "nullsNotDistinct": false, + "name": "problem_tags_problem_id_problemtag_id_318459d1_uniq" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.problem_tag": { + "name": "problem_tag", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "problem_tag_name_ci_unique": { + "name": "problem_tag_name_ci_unique", + "columns": [ + { + "expression": "lower(name)", + "asc": true, + "nulls": "last", + "opclass": "text_ops", + "isExpression": true + } + ], + "isUnique": true, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.submission": { + "name": "submission", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "text", + "primaryKey": true, + "notNull": true + }, + "contest_id": { + "name": "contest_id", + "type": "integer", + "primaryKey": false, + "notNull": false + }, + "problem_id": { + "name": "problem_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "result": { + "name": "result", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 6 + }, + "info": { + "name": "info", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "language": { + "name": "language", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "shared": { + "name": "shared", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "statistic_info": { + "name": "statistic_info", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "ip": { + "name": "ip", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": { + "contest_create_time_idx": { + "name": "contest_create_time_idx", + "columns": [ + { + "expression": "contest_id", + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops", + "isExpression": false + }, + { + "expression": "create_time", + "asc": false, + "nulls": "first", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "problem_user_idx": { + "name": "problem_user_idx", + "columns": [ + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "submission_contest_id_775716d5": { + "name": "submission_contest_id_775716d5", + "columns": [ + { + "expression": "contest_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "submission_problem_id_76847b55": { + "name": "submission_problem_id_76847b55", + "columns": [ + { + "expression": "problem_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "submission_result_37e2f67a": { + "name": "submission_result_37e2f67a", + "columns": [ + { + "expression": "result", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "submission_user_id_3779a8c1": { + "name": "submission_user_id_3779a8c1", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_create_time_idx": { + "name": "user_create_time_idx", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "create_time", + "asc": true, + "nulls": "last", + "opclass": "timestamptz_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "submission_contest_id_775716d5_fk_contest_id": { + "name": "submission_contest_id_775716d5_fk_contest_id", + "tableFrom": "submission", + "tableTo": "contest", + "schemaTo": "public", + "columnsFrom": [ + "contest_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "submission_problem_id_76847b55_fk_problem_id": { + "name": "submission_problem_id_76847b55_fk_problem_id", + "tableFrom": "submission", + "tableTo": "problem", + "schemaTo": "public", + "columnsFrom": [ + "problem_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.tutorial": { + "name": "tutorial", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "integer", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "tutorial_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "2147483647", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "title": { + "name": "title", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true + }, + "content": { + "name": "content", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "created_at": { + "name": "created_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "updated_at": { + "name": "updated_at", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "is_public": { + "name": "is_public", + "type": "boolean", + "primaryKey": false, + "notNull": true + }, + "order": { + "name": "order", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "created_by_id": { + "name": "created_by_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "code": { + "name": "code", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "type": { + "name": "type", + "type": "varchar(10)", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "tutorial_created_by_id_07973cab": { + "name": "tutorial_created_by_id_07973cab", + "columns": [ + { + "expression": "created_by_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "tutorial_created_by_id_07973cab_fk_user_id": { + "name": "tutorial_created_by_id_07973cab_fk_user_id", + "tableFrom": "tutorial", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "created_by_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.user_stat": { + "name": "user_stat", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "user_stat_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "metrics": { + "name": "metrics", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "update_time": { + "name": "update_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": {}, + "foreignKeys": { + "user_stat_user_id_73337fc0_fk_user_id": { + "name": "user_stat_user_id_73337fc0_fk_user_id", + "tableFrom": "user_stat", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_stat_user_id_key": { + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "user_stat_user_id_key" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.user_achievement": { + "name": "user_achievement", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "user_achievement_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "unlock_time": { + "name": "unlock_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "backfilled": { + "name": "backfilled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "notified": { + "name": "notified", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "achievement_id": { + "name": "achievement_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "user_achievement_achievement_id_29db600d": { + "name": "user_achievement_achievement_id_29db600d", + "columns": [ + { + "expression": "achievement_id", + "asc": true, + "nulls": "last", + "opclass": "int8_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_achievement_user_id_b8ec7d6a": { + "name": "user_achievement_user_id_b8ec7d6a", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_achv_notified_idx": { + "name": "user_achv_notified_idx", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "notified", + "asc": true, + "nulls": "last", + "opclass": "bool_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_achv_time_idx": { + "name": "user_achv_time_idx", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "unlock_time", + "asc": false, + "nulls": "first", + "opclass": "timestamptz_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "user_achievement_achievement_id_29db600d_fk_achievement_id": { + "name": "user_achievement_achievement_id_29db600d_fk_achievement_id", + "tableFrom": "user_achievement", + "tableTo": "achievement", + "schemaTo": "public", + "columnsFrom": [ + "achievement_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_achievement_user_id_b8ec7d6a_fk_user_id": { + "name": "user_achievement_user_id_b8ec7d6a_fk_user_id", + "tableFrom": "user_achievement", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "unique_user_achievement": { + "columns": [ + "achievement_id", + "user_id" + ], + "nullsNotDistinct": false, + "name": "unique_user_achievement" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.user_badge": { + "name": "user_badge", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "user_badge_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "earned_time": { + "name": "earned_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": true + }, + "badge_id": { + "name": "badge_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "user_badge_badge_id_92a983e9": { + "name": "user_badge_badge_id_92a983e9", + "columns": [ + { + "expression": "badge_id", + "asc": true, + "nulls": "last", + "opclass": "int8_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "user_badge_user_id_a286d718": { + "name": "user_badge_user_id_a286d718", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "user_badge_badge_id_92a983e9_fk_problemset_badge_id": { + "name": "user_badge_badge_id_92a983e9_fk_problemset_badge_id", + "tableFrom": "user_badge", + "tableTo": "problemset_badge", + "schemaTo": "public", + "columnsFrom": [ + "badge_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "user_badge_user_id_a286d718_fk_user_id": { + "name": "user_badge_user_id_a286d718_fk_user_id", + "tableFrom": "user_badge", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "unique_user_badge": { + "columns": [ + "badge_id", + "user_id" + ], + "nullsNotDistinct": false, + "name": "unique_user_badge" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.user_profile": { + "name": "user_profile", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "acm_problems_status": { + "name": "acm_problems_status", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "avatar": { + "name": "avatar", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "blog": { + "name": "blog", + "type": "varchar(200)", + "primaryKey": false, + "notNull": false + }, + "mood": { + "name": "mood", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "accepted_number": { + "name": "accepted_number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "submission_number": { + "name": "submission_number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "github": { + "name": "github", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "school": { + "name": "school", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "major": { + "name": "major", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "real_name": { + "name": "real_name", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "language": { + "name": "language", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": { + "user_profile_user_id_8fdce8e2_fk_user_id": { + "name": "user_profile_user_id_8fdce8e2_fk_user_id", + "tableFrom": "user_profile", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_profile_user_id_key": { + "columns": [ + "user_id" + ], + "nullsNotDistinct": false, + "name": "user_profile_user_id_key" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.acm_contest_rank": { + "name": "acm_contest_rank", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "submission_number": { + "name": "submission_number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "accepted_number": { + "name": "accepted_number", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "total_time": { + "name": "total_time", + "type": "integer", + "primaryKey": false, + "notNull": true, + "default": 0 + }, + "submission_info": { + "name": "submission_info", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'{}'::jsonb" + }, + "contest_id": { + "name": "contest_id", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "user_id": { + "name": "user_id", + "type": "integer", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "acm_contest_rank_contest_id_21030ccd": { + "name": "acm_contest_rank_contest_id_21030ccd", + "columns": [ + { + "expression": "contest_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "acm_contest_rank_user_id_40391ab2": { + "name": "acm_contest_rank_user_id_40391ab2", + "columns": [ + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "acm_rank_contest_user_idx": { + "name": "acm_rank_contest_user_idx", + "columns": [ + { + "expression": "contest_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "user_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + }, + "acm_rank_order_idx": { + "name": "acm_rank_order_idx", + "columns": [ + { + "expression": "contest_id", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "accepted_number", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + }, + { + "expression": "total_time", + "asc": true, + "nulls": "last", + "opclass": "int4_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "acm_contest_rank_contest_id_21030ccd_fk_contest_id": { + "name": "acm_contest_rank_contest_id_21030ccd_fk_contest_id", + "tableFrom": "acm_contest_rank", + "tableTo": "contest", + "schemaTo": "public", + "columnsFrom": [ + "contest_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + }, + "acm_contest_rank_user_id_40391ab2_fk_user_id": { + "name": "acm_contest_rank_user_id_40391ab2_fk_user_id", + "tableFrom": "acm_contest_rank", + "tableTo": "user", + "schemaTo": "public", + "columnsFrom": [ + "user_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "unique_acm_rank_user_contest": { + "columns": [ + "contest_id", + "user_id" + ], + "nullsNotDistinct": false, + "name": "unique_acm_rank_user_contest" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.user": { + "name": "user", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "serial", + "primaryKey": true, + "notNull": true + }, + "password": { + "name": "password", + "type": "varchar(128)", + "primaryKey": false, + "notNull": true + }, + "last_login": { + "name": "last_login", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "username": { + "name": "username", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "email": { + "name": "email", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "create_time": { + "name": "create_time", + "type": "timestamp with time zone", + "primaryKey": false, + "notNull": false + }, + "admin_type": { + "name": "admin_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "auth_token": { + "name": "auth_token", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "open_api": { + "name": "open_api", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "open_api_appkey": { + "name": "open_api_appkey", + "type": "text", + "primaryKey": false, + "notNull": false + }, + "is_disabled": { + "name": "is_disabled", + "type": "boolean", + "primaryKey": false, + "notNull": true, + "default": false + }, + "problem_permission": { + "name": "problem_permission", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "session_keys": { + "name": "session_keys", + "type": "jsonb", + "primaryKey": false, + "notNull": true, + "default": "'[]'::jsonb" + }, + "raw_password": { + "name": "raw_password", + "type": "varchar(20)", + "primaryKey": false, + "notNull": false + }, + "class_name": { + "name": "class_name", + "type": "text", + "primaryKey": false, + "notNull": false + } + }, + "indexes": {}, + "foreignKeys": {}, + "compositePrimaryKeys": {}, + "uniqueConstraints": { + "user_username_key": { + "columns": [ + "username" + ], + "nullsNotDistinct": false, + "name": "user_username_key" + } + }, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + }, + "public.problemset_badge": { + "name": "problemset_badge", + "schema": "", + "columns": { + "id": { + "name": "id", + "type": "bigint", + "primaryKey": true, + "notNull": true, + "identity": { + "type": "byDefault", + "name": "problemset_badge_id_seq", + "increment": "1", + "minValue": "1", + "maxValue": "9223372036854775807", + "startWith": "1", + "cache": "1", + "cycle": false, + "schema": "public" + } + }, + "name": { + "name": "name", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "description": { + "name": "description", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "icon": { + "name": "icon", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "condition_type": { + "name": "condition_type", + "type": "text", + "primaryKey": false, + "notNull": true + }, + "condition_value": { + "name": "condition_value", + "type": "integer", + "primaryKey": false, + "notNull": true + }, + "problemset_id": { + "name": "problemset_id", + "type": "bigint", + "primaryKey": false, + "notNull": true + } + }, + "indexes": { + "problemset_badge_problemset_id_6cb6c74f": { + "name": "problemset_badge_problemset_id_6cb6c74f", + "columns": [ + { + "expression": "problemset_id", + "asc": true, + "nulls": "last", + "opclass": "int8_ops", + "isExpression": false + } + ], + "isUnique": false, + "concurrently": false, + "method": "btree", + "with": {} + } + }, + "foreignKeys": { + "problemset_badge_problemset_id_6cb6c74f_fk_problemset_id": { + "name": "problemset_badge_problemset_id_6cb6c74f_fk_problemset_id", + "tableFrom": "problemset_badge", + "tableTo": "problemset", + "schemaTo": "public", + "columnsFrom": [ + "problemset_id" + ], + "columnsTo": [ + "id" + ], + "onDelete": "no action", + "onUpdate": "no action" + } + }, + "compositePrimaryKeys": {}, + "uniqueConstraints": {}, + "checkConstraints": {}, + "policies": {}, + "isRLSEnabled": false + } + }, + "enums": {}, + "schemas": {}, + "sequences": { + "public.auth_group_id_seq": { + "name": "auth_group_id_seq", + "schema": "public", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "increment": "1", + "cycle": false, + "cache": "1" + }, + "public.auth_group_permissions_id_seq": { + "name": "auth_group_permissions_id_seq", + "schema": "public", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "increment": "1", + "cycle": false, + "cache": "1" + }, + "public.auth_permission_id_seq": { + "name": "auth_permission_id_seq", + "schema": "public", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "increment": "1", + "cycle": false, + "cache": "1" + }, + "public.django_content_type_id_seq": { + "name": "django_content_type_id_seq", + "schema": "public", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "increment": "1", + "cycle": false, + "cache": "1" + }, + "public.django_migrations_id_seq": { + "name": "django_migrations_id_seq", + "schema": "public", + "startWith": "1", + "minValue": "1", + "maxValue": "2147483647", + "increment": "1", + "cycle": false, + "cache": "1" + } + }, + "roles": {}, + "policies": {}, + "views": {}, + "_meta": { + "schemas": {}, + "tables": {}, + "columns": {} + }, + "internal": { + "tables": {} + } +} \ No newline at end of file diff --git a/apps/api/src/db/meta/_journal.json b/apps/api/src/db/meta/_journal.json new file mode 100644 index 0000000..0a15702 --- /dev/null +++ b/apps/api/src/db/meta/_journal.json @@ -0,0 +1,13 @@ +{ + "version": "7", + "dialect": "postgresql", + "entries": [ + { + "idx": 0, + "version": "7", + "when": 1786070652521, + "tag": "0000_crazy_gateway", + "breakpoints": true + } + ] +} \ No newline at end of file diff --git a/apps/api/src/db/relations.ts b/apps/api/src/db/relations.ts new file mode 100644 index 0000000..acf1300 --- /dev/null +++ b/apps/api/src/db/relations.ts @@ -0,0 +1,273 @@ +import { relations } from "drizzle-orm/relations"; +import { user, aiAnalysis, announcement, contest, contestAnnouncement, problem, flowchartSubmission, message, submission, tutorial, exercise, problemset, problemsetProblem, problemsetProgress, problemsetSubmission, reaction, problemTags, problemTag, userStat, achievement, userAchievement, problemsetBadge, userBadge, userProfile, acmContestRank } from "./schema"; + +export const aiAnalysisRelations = relations(aiAnalysis, ({one}) => ({ + user: one(user, { + fields: [aiAnalysis.userId], + references: [user.id] + }), +})); + +export const userRelations = relations(user, ({many}) => ({ + aiAnalyses: many(aiAnalysis), + announcements: many(announcement), + contests: many(contest), + contestAnnouncements: many(contestAnnouncement), + flowchartSubmissions: many(flowchartSubmission), + messages_recipientId: many(message, { + relationName: "message_recipientId_user_id" + }), + messages_senderId: many(message, { + relationName: "message_senderId_user_id" + }), + problemsets: many(problemset), + problemsetProgresses: many(problemsetProgress), + problemsetSubmissions: many(problemsetSubmission), + reactions: many(reaction), + problems: many(problem), + tutorials: many(tutorial), + userStats: many(userStat), + userAchievements: many(userAchievement), + userBadges: many(userBadge), + userProfiles: many(userProfile), + acmContestRanks: many(acmContestRank), +})); + +export const announcementRelations = relations(announcement, ({one}) => ({ + user: one(user, { + fields: [announcement.createdById], + references: [user.id] + }), +})); + +export const contestRelations = relations(contest, ({one, many}) => ({ + user: one(user, { + fields: [contest.createdById], + references: [user.id] + }), + contestAnnouncements: many(contestAnnouncement), + problems: many(problem), + submissions: many(submission), + acmContestRanks: many(acmContestRank), +})); + +export const contestAnnouncementRelations = relations(contestAnnouncement, ({one}) => ({ + contest: one(contest, { + fields: [contestAnnouncement.contestId], + references: [contest.id] + }), + user: one(user, { + fields: [contestAnnouncement.createdById], + references: [user.id] + }), +})); + +export const flowchartSubmissionRelations = relations(flowchartSubmission, ({one}) => ({ + problem: one(problem, { + fields: [flowchartSubmission.problemId], + references: [problem.id] + }), + user: one(user, { + fields: [flowchartSubmission.userId], + references: [user.id] + }), +})); + +export const problemRelations = relations(problem, ({one, many}) => ({ + flowchartSubmissions: many(flowchartSubmission), + problemsetProblems: many(problemsetProblem), + problemsetSubmissions: many(problemsetSubmission), + reactions: many(reaction), + contest: one(contest, { + fields: [problem.contestId], + references: [contest.id] + }), + user: one(user, { + fields: [problem.createdById], + references: [user.id] + }), + problemTags: many(problemTags), + submissions: many(submission), +})); + +export const messageRelations = relations(message, ({one}) => ({ + user_recipientId: one(user, { + fields: [message.recipientId], + references: [user.id], + relationName: "message_recipientId_user_id" + }), + user_senderId: one(user, { + fields: [message.senderId], + references: [user.id], + relationName: "message_senderId_user_id" + }), + submission: one(submission, { + fields: [message.submissionId], + references: [submission.id] + }), +})); + +export const submissionRelations = relations(submission, ({one, many}) => ({ + messages: many(message), + problemsetSubmissions: many(problemsetSubmission), + contest: one(contest, { + fields: [submission.contestId], + references: [contest.id] + }), + problem: one(problem, { + fields: [submission.problemId], + references: [problem.id] + }), +})); + +export const exerciseRelations = relations(exercise, ({one}) => ({ + tutorial: one(tutorial, { + fields: [exercise.tutorialId], + references: [tutorial.id] + }), +})); + +export const tutorialRelations = relations(tutorial, ({one, many}) => ({ + exercises: many(exercise), + user: one(user, { + fields: [tutorial.createdById], + references: [user.id] + }), +})); + +export const problemsetRelations = relations(problemset, ({one, many}) => ({ + user: one(user, { + fields: [problemset.createdById], + references: [user.id] + }), + problemsetProblems: many(problemsetProblem), + problemsetProgresses: many(problemsetProgress), + problemsetSubmissions: many(problemsetSubmission), + problemsetBadges: many(problemsetBadge), +})); + +export const problemsetProblemRelations = relations(problemsetProblem, ({one}) => ({ + problem: one(problem, { + fields: [problemsetProblem.problemId], + references: [problem.id] + }), + problemset: one(problemset, { + fields: [problemsetProblem.problemsetId], + references: [problemset.id] + }), +})); + +export const problemsetProgressRelations = relations(problemsetProgress, ({one}) => ({ + problemset: one(problemset, { + fields: [problemsetProgress.problemsetId], + references: [problemset.id] + }), + user: one(user, { + fields: [problemsetProgress.userId], + references: [user.id] + }), +})); + +export const problemsetSubmissionRelations = relations(problemsetSubmission, ({one}) => ({ + problem: one(problem, { + fields: [problemsetSubmission.problemId], + references: [problem.id] + }), + problemset: one(problemset, { + fields: [problemsetSubmission.problemsetId], + references: [problemset.id] + }), + submission: one(submission, { + fields: [problemsetSubmission.submissionId], + references: [submission.id] + }), + user: one(user, { + fields: [problemsetSubmission.userId], + references: [user.id] + }), +})); + +export const reactionRelations = relations(reaction, ({one}) => ({ + problem: one(problem, { + fields: [reaction.problemId], + references: [problem.id] + }), + user: one(user, { + fields: [reaction.userId], + references: [user.id] + }), +})); + +export const problemTagsRelations = relations(problemTags, ({one}) => ({ + problem: one(problem, { + fields: [problemTags.problemId], + references: [problem.id] + }), + problemTag: one(problemTag, { + fields: [problemTags.problemtagId], + references: [problemTag.id] + }), +})); + +export const problemTagRelations = relations(problemTag, ({many}) => ({ + problemTags: many(problemTags), +})); + +export const userStatRelations = relations(userStat, ({one}) => ({ + user: one(user, { + fields: [userStat.userId], + references: [user.id] + }), +})); + +export const userAchievementRelations = relations(userAchievement, ({one}) => ({ + achievement: one(achievement, { + fields: [userAchievement.achievementId], + references: [achievement.id] + }), + user: one(user, { + fields: [userAchievement.userId], + references: [user.id] + }), +})); + +export const achievementRelations = relations(achievement, ({many}) => ({ + userAchievements: many(userAchievement), +})); + +export const userBadgeRelations = relations(userBadge, ({one}) => ({ + problemsetBadge: one(problemsetBadge, { + fields: [userBadge.badgeId], + references: [problemsetBadge.id] + }), + user: one(user, { + fields: [userBadge.userId], + references: [user.id] + }), +})); + +export const problemsetBadgeRelations = relations(problemsetBadge, ({one, many}) => ({ + userBadges: many(userBadge), + problemset: one(problemset, { + fields: [problemsetBadge.problemsetId], + references: [problemset.id] + }), +})); + +export const userProfileRelations = relations(userProfile, ({one}) => ({ + user: one(user, { + fields: [userProfile.userId], + references: [user.id] + }), +})); + +export const acmContestRankRelations = relations(acmContestRank, ({one}) => ({ + contest: one(contest, { + fields: [acmContestRank.contestId], + references: [contest.id] + }), + user: one(user, { + fields: [acmContestRank.userId], + references: [user.id] + }), +})); \ No newline at end of file diff --git a/apps/api/src/db/schema.ts b/apps/api/src/db/schema.ts new file mode 100644 index 0000000..93a3214 --- /dev/null +++ b/apps/api/src/db/schema.ts @@ -0,0 +1,652 @@ +// 本文件由 `drizzle-kit pull` 从本地库自动生成,drizzle.config.ts 的 tablesFilter +// (["!django_*", "!auth_*"]) 已生效:34 张表中的 7 张 Django 框架表 +// (auth_group、auth_group_permissions、auth_permission、django_content_type、 +// django_dramatiq_task、django_migrations、django_session) 均未生成 pgTable 定义, +// 剩余 27 张业务表原样保留。 +// +// 手工剪枝:tablesFilter 只过滤了 pgTable,未过滤这些框架表的 id 序列,遗留了 +// 5 个孤儿 pgSequence 导出(authGroupIdSeq、authGroupPermissionsIdSeq、 +// authPermissionIdSeq、djangoContentTypeIdSeq、djangoMigrationsIdSeq)—— +// 它们不被任何剩余表引用,留着只会在未来 `drizzle-kit generate` 时生成多余的 +// `CREATE SEQUENCE` 迁移,因此手工删除。 +import { pgTable, index, foreignKey, bigint, text, jsonb, timestamp, integer, boolean, serial, doublePrecision, varchar, unique, uniqueIndex } from "drizzle-orm/pg-core" +import { sql } from "drizzle-orm" + +export const aiAnalysis = pgTable("ai_analysis", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "ai_analysis_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + provider: text().notNull(), + data: jsonb().notNull(), + systemPrompt: text("system_prompt").notNull(), + userPrompt: text("user_prompt").notNull(), + analysis: text().notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + userId: integer("user_id").notNull(), + model: text().notNull(), + isPinned: boolean("is_pinned").notNull(), +}, (table) => [ + index("ai_analysis_user_id_3aa23011").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "ai_analysis_user_id_3aa23011_fk_user_id" + }), +]); + +export const announcement = pgTable("announcement", { + id: serial().primaryKey().notNull(), + title: text().notNull(), + content: text().notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + lastUpdateTime: timestamp("last_update_time", { withTimezone: true, mode: 'string' }).notNull(), + visible: boolean().notNull(), + createdById: integer("created_by_id").notNull(), + tag: text().notNull(), + top: boolean().notNull(), +}, (table) => [ + index("announcement_created_by_id_359ccf50").using("btree", table.createdById.asc().nullsLast().op("int4_ops")), + index("announcement_list_idx").using("btree", table.visible.asc().nullsLast().op("bool_ops"), table.top.desc().nullsFirst().op("bool_ops"), table.createTime.desc().nullsFirst().op("bool_ops")), + foreignKey({ + columns: [table.createdById], + foreignColumns: [user.id], + name: "announcement_created_by_id_359ccf50_fk_user_id" + }), +]); + +export const achievement = pgTable("achievement", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "achievement_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + name: text().notNull(), + description: text().notNull(), + icon: text().notNull(), + rarity: text().notNull(), + hidden: boolean().default(false).notNull(), + metric: text().notNull(), + operator: text().notNull(), + threshold: integer().notNull(), + visible: boolean().default(true).notNull(), + unlockCount: integer("unlock_count").default(0).notNull(), + order: integer().default(0).notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), +}); + +export const contest = pgTable("contest", { + id: serial().primaryKey().notNull(), + title: text().notNull(), + description: text().notNull(), + password: text(), + startTime: timestamp("start_time", { withTimezone: true, mode: 'string' }).notNull(), + endTime: timestamp("end_time", { withTimezone: true, mode: 'string' }).notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + lastUpdateTime: timestamp("last_update_time", { withTimezone: true, mode: 'string' }).notNull(), + visible: boolean().notNull(), + createdById: integer("created_by_id").notNull(), + allowedIpRanges: jsonb("allowed_ip_ranges").notNull(), + tag: text().notNull(), +}, (table) => [ + index("contest_created_by_id_a763ca7e").using("btree", table.createdById.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.createdById], + foreignColumns: [user.id], + name: "contest_created_by_id_a763ca7e_fk_user_id" + }), +]); + +export const contestAnnouncement = pgTable("contest_announcement", { + id: serial().primaryKey().notNull(), + title: text().notNull(), + content: text().notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + contestId: integer("contest_id").notNull(), + createdById: integer("created_by_id").notNull(), + visible: boolean().notNull(), +}, (table) => [ + index("contest_announcement_contest_id_a8cb419f").using("btree", table.contestId.asc().nullsLast().op("int4_ops")), + index("contest_announcement_created_by_id_469a14ce").using("btree", table.createdById.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.contestId], + foreignColumns: [contest.id], + name: "contest_announcement_contest_id_a8cb419f_fk_contest_id" + }), + foreignKey({ + columns: [table.createdById], + foreignColumns: [user.id], + name: "contest_announcement_created_by_id_469a14ce_fk_user_id" + }), +]); + +export const flowchartSubmission = pgTable("flowchart_submission", { + id: text().primaryKey().notNull(), + mermaidCode: text("mermaid_code").notNull(), + flowchartData: jsonb("flowchart_data").notNull(), + status: integer().notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + aiScore: doublePrecision("ai_score"), + aiGrade: varchar("ai_grade", { length: 10 }), + aiFeedback: text("ai_feedback"), + aiSuggestions: text("ai_suggestions"), + aiCriteriaDetails: jsonb("ai_criteria_details").notNull(), + aiProvider: varchar("ai_provider", { length: 50 }).notNull(), + aiModel: varchar("ai_model", { length: 50 }).notNull(), + processingTime: doublePrecision("processing_time"), + evaluationTime: timestamp("evaluation_time", { withTimezone: true, mode: 'string' }), + problemId: integer("problem_id").notNull(), + userId: integer("user_id").notNull(), +}, (table) => [ + index("flowchart_problem_time_idx").using("btree", table.problemId.asc().nullsLast().op("int4_ops"), table.createTime.asc().nullsLast().op("int4_ops")), + index("flowchart_status_idx").using("btree", table.status.asc().nullsLast().op("int4_ops")), + index("flowchart_submission_id_0dbfc4f9_like").using("btree", table.id.asc().nullsLast().op("text_pattern_ops")), + index("flowchart_submission_problem_id_8551edbf").using("btree", table.problemId.asc().nullsLast().op("int4_ops")), + index("flowchart_submission_user_id_225c83e8").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + index("flowchart_user_time_idx").using("btree", table.userId.asc().nullsLast().op("int4_ops"), table.createTime.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.problemId], + foreignColumns: [problem.id], + name: "flowchart_submission_problem_id_8551edbf_fk_problem_id" + }), + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "flowchart_submission_user_id_225c83e8_fk_user_id" + }), +]); + +export const message = pgTable("message", { + id: integer().primaryKey().generatedByDefaultAsIdentity({ name: "message_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }), + message: text().notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + recipientId: integer("recipient_id").notNull(), + senderId: integer("sender_id").notNull(), + submissionId: text("submission_id").notNull(), +}, (table) => [ + index("message_recipient_id_2aa5dd76").using("btree", table.recipientId.asc().nullsLast().op("int4_ops")), + index("message_recipient_time_idx").using("btree", table.recipientId.asc().nullsLast().op("timestamptz_ops"), table.createTime.asc().nullsLast().op("int4_ops")), + index("message_sender_id_a2a2e825").using("btree", table.senderId.asc().nullsLast().op("int4_ops")), + index("message_submission_id_2fdf8a47").using("btree", table.submissionId.asc().nullsLast().op("text_ops")), + index("message_submission_id_2fdf8a47_like").using("btree", table.submissionId.asc().nullsLast().op("text_pattern_ops")), + foreignKey({ + columns: [table.recipientId], + foreignColumns: [user.id], + name: "message_recipient_id_2aa5dd76_fk_user_id" + }), + foreignKey({ + columns: [table.senderId], + foreignColumns: [user.id], + name: "message_sender_id_a2a2e825_fk_user_id" + }), + foreignKey({ + columns: [table.submissionId], + foreignColumns: [submission.id], + name: "message_submission_id_2fdf8a47_fk_submission_id" + }), +]); + +export const judgeServer = pgTable("judge_server", { + id: serial().primaryKey().notNull(), + hostname: text().notNull(), + ip: text(), + judgerVersion: text("judger_version").notNull(), + cpuCore: integer("cpu_core").notNull(), + memoryUsage: doublePrecision("memory_usage").notNull(), + cpuUsage: doublePrecision("cpu_usage").notNull(), + lastHeartbeat: timestamp("last_heartbeat", { withTimezone: true, mode: 'string' }).notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + taskNumber: integer("task_number").notNull(), + serviceUrl: text("service_url"), + isDisabled: boolean("is_disabled").notNull(), +}); + +export const exercise = pgTable("exercise", { + id: integer().primaryKey().generatedByDefaultAsIdentity({ name: "exercise_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }), + type: varchar({ length: 16 }).notNull(), + data: jsonb().notNull(), + order: integer().notNull(), + createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).notNull(), + tutorialId: integer("tutorial_id").notNull(), +}, (table) => [ + index("exercise_tutorial_id_6fd04055").using("btree", table.tutorialId.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.tutorialId], + foreignColumns: [tutorial.id], + name: "exercise_tutorial_id_6fd04055_fk_tutorial_id" + }), +]); + +export const optionsSysoptions = pgTable("options_sysoptions", { + id: serial().primaryKey().notNull(), + key: text().notNull(), + value: jsonb().notNull(), +}, (table) => [ + unique("options_sysoptions_key_key").on(table.key), +]); + +export const problemset = pgTable("problemset", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "problemset_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + title: text().notNull(), + description: text().notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + lastUpdateTime: timestamp("last_update_time", { withTimezone: true, mode: 'string' }).notNull(), + visible: boolean().notNull(), + difficulty: text().notNull(), + status: text().notNull(), + createdById: integer("created_by_id").notNull(), + endTime: timestamp("end_time", { withTimezone: true, mode: 'string' }), +}, (table) => [ + index("problemset_created_by_id_01b5197f").using("btree", table.createdById.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.createdById], + foreignColumns: [user.id], + name: "problemset_created_by_id_01b5197f_fk_user_id" + }), +]); + +export const problemsetProblem = pgTable("problemset_problem", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "problemset_problem_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + order: integer().notNull(), + isRequired: boolean("is_required").notNull(), + score: integer().notNull(), + hint: text(), + problemId: integer("problem_id").notNull(), + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + problemsetId: bigint("problemset_id", { mode: "number" }).notNull(), +}, (table) => [ + index("problemset_problem_problem_id_fff2d686").using("btree", table.problemId.asc().nullsLast().op("int4_ops")), + index("problemset_problem_problemset_id_350d17fb").using("btree", table.problemsetId.asc().nullsLast().op("int8_ops")), + foreignKey({ + columns: [table.problemId], + foreignColumns: [problem.id], + name: "problemset_problem_problem_id_fff2d686_fk_problem_id" + }), + foreignKey({ + columns: [table.problemsetId], + foreignColumns: [problemset.id], + name: "problemset_problem_problemset_id_350d17fb_fk_problemset_id" + }), + unique("unique_problemset_problem").on(table.problemId, table.problemsetId), +]); + +export const problemsetProgress = pgTable("problemset_progress", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "problemset_progress_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + joinTime: timestamp("join_time", { withTimezone: true, mode: 'string' }).notNull(), + completeTime: timestamp("complete_time", { withTimezone: true, mode: 'string' }), + isCompleted: boolean("is_completed").notNull(), + progressPercentage: doublePrecision("progress_percentage").notNull(), + completedProblemsCount: integer("completed_problems_count").notNull(), + totalProblemsCount: integer("total_problems_count").notNull(), + totalScore: integer("total_score").notNull(), + progressDetail: jsonb("progress_detail").notNull(), + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + problemsetId: bigint("problemset_id", { mode: "number" }).notNull(), + userId: integer("user_id").notNull(), +}, (table) => [ + index("problemset_progress_problemset_id_20a9632e").using("btree", table.problemsetId.asc().nullsLast().op("int8_ops")), + index("problemset_progress_user_id_c8041a80").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.problemsetId], + foreignColumns: [problemset.id], + name: "problemset_progress_problemset_id_20a9632e_fk_problemset_id" + }), + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "problemset_progress_user_id_c8041a80_fk_user_id" + }), + unique("unique_problemset_progress_user").on(table.problemsetId, table.userId), +]); + +export const problemsetSubmission = pgTable("problemset_submission", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "problemset_submission_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + problemId: integer("problem_id").notNull(), + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + problemsetId: bigint("problemset_id", { mode: "number" }).notNull(), + submissionId: text("submission_id").notNull(), + userId: integer("user_id").notNull(), +}, (table) => [ + index("problemset__problem_1f39fa_idx").using("btree", table.problemsetId.asc().nullsLast().op("int4_ops"), table.userId.asc().nullsLast().op("int4_ops")), + index("problemset__problem_22f053_idx").using("btree", table.problemsetId.asc().nullsLast().op("int8_ops"), table.problemId.asc().nullsLast().op("int8_ops")), + index("problemset__user_id_2f1501_idx").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + index("problemset_submission_problem_id_5629b105").using("btree", table.problemId.asc().nullsLast().op("int4_ops")), + index("problemset_submission_problemset_id_85290e17").using("btree", table.problemsetId.asc().nullsLast().op("int8_ops")), + index("problemset_submission_submission_id_78e2b807").using("btree", table.submissionId.asc().nullsLast().op("text_ops")), + index("problemset_submission_submission_id_78e2b807_like").using("btree", table.submissionId.asc().nullsLast().op("text_pattern_ops")), + index("problemset_submission_user_id_915fc9c6").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.problemId], + foreignColumns: [problem.id], + name: "problemset_submission_problem_id_5629b105_fk_problem_id" + }), + foreignKey({ + columns: [table.problemsetId], + foreignColumns: [problemset.id], + name: "problemset_submission_problemset_id_85290e17_fk_problemset_id" + }), + foreignKey({ + columns: [table.submissionId], + foreignColumns: [submission.id], + name: "problemset_submission_submission_id_78e2b807_fk_submission_id" + }), + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "problemset_submission_user_id_915fc9c6_fk_user_id" + }), +]); + +export const reaction = pgTable("reaction", { + id: integer().primaryKey().generatedByDefaultAsIdentity({ name: "reaction_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }), + type: varchar({ length: 20 }).notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + problemId: integer("problem_id").notNull(), + userId: integer("user_id").notNull(), +}, (table) => [ + index("reaction_problem_id_a7f3b9f3").using("btree", table.problemId.asc().nullsLast().op("int4_ops")), + index("reaction_problem_type_idx").using("btree", table.problemId.asc().nullsLast().op("int4_ops"), table.type.asc().nullsLast().op("int4_ops")), + index("reaction_user_id_cfa7f469").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.problemId], + foreignColumns: [problem.id], + name: "reaction_problem_id_a7f3b9f3_fk_problem_id" + }), + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "reaction_user_id_cfa7f469_fk_user_id" + }), + unique("reaction_problem_user_unique").on(table.problemId, table.userId), +]); + +export const problem = pgTable("problem", { + id: serial().primaryKey().notNull(), + title: text().notNull(), + description: text().notNull(), + inputDescription: text("input_description").notNull(), + outputDescription: text("output_description").notNull(), + samples: jsonb().notNull(), + testCaseId: text("test_case_id").notNull(), + testCaseScore: jsonb("test_case_score").notNull(), + hint: text(), + languages: jsonb().notNull(), + template: jsonb().notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + lastUpdateTime: timestamp("last_update_time", { withTimezone: true, mode: 'string' }), + timeLimit: integer("time_limit").notNull(), + memoryLimit: integer("memory_limit").notNull(), + visible: boolean().default(true).notNull(), + difficulty: text().notNull(), + source: text(), + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + submissionNumber: bigint("submission_number", { mode: "number" }).default(0).notNull(), + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + acceptedNumber: bigint("accepted_number", { mode: "number" }).default(0).notNull(), + createdById: integer("created_by_id").notNull(), + id: text("_id").notNull(), + statisticInfo: jsonb("statistic_info").default({}).notNull(), + contestId: integer("contest_id"), + isPublic: boolean("is_public").default(false).notNull(), + shareSubmission: boolean("share_submission").default(false).notNull(), + prompt: text(), + answers: jsonb(), + allowFlowchart: boolean("allow_flowchart").default(false).notNull(), + flowchartData: jsonb("flowchart_data").default({}).notNull(), + flowchartHint: text("flowchart_hint"), + mermaidCode: text("mermaid_code"), + showFlowchart: boolean("show_flowchart").default(false).notNull(), + astRules: jsonb("ast_rules"), + sqlConfig: jsonb("sql_config"), + sqlDisplay: jsonb("sql_display"), +}, (table) => [ + index("problem__id_919b1d80").using("btree", table.id.asc().nullsLast().op("text_ops")), + index("problem_contest_id_328e013a").using("btree", table.contestId.asc().nullsLast().op("int4_ops")), + index("problem_contest_visible_idx").using("btree", table.contestId.asc().nullsLast().op("bool_ops"), table.visible.asc().nullsLast().op("int4_ops")), + index("problem_created_by_id_cb362143").using("btree", table.createdById.asc().nullsLast().op("int4_ops")), + index("problem_visible_idx").using("btree", table.visible.asc().nullsLast().op("bool_ops")), + foreignKey({ + columns: [table.contestId], + foreignColumns: [contest.id], + name: "problem_contest_id_328e013a_fk_contest_id" + }), + foreignKey({ + columns: [table.createdById], + foreignColumns: [user.id], + name: "problem_created_by_id_cb362143_fk_user_id" + }), + unique("unique_problem_id_contest").on(table.id, table.contestId), +]); + +export const problemTags = pgTable("problem_tags", { + id: serial().primaryKey().notNull(), + problemId: integer("problem_id").notNull(), + problemtagId: integer("problemtag_id").notNull(), +}, (table) => [ + index("problem_tags_problem_id_866ecb8d").using("btree", table.problemId.asc().nullsLast().op("int4_ops")), + index("problem_tags_problemtag_id_72d20571").using("btree", table.problemtagId.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.problemId], + foreignColumns: [problem.id], + name: "problem_tags_problem_id_866ecb8d_fk_problem_id" + }), + foreignKey({ + columns: [table.problemtagId], + foreignColumns: [problemTag.id], + name: "problem_tags_problemtag_id_72d20571_fk_problem_tag_id" + }), + unique("problem_tags_problem_id_problemtag_id_318459d1_uniq").on(table.problemId, table.problemtagId), +]); + +export const problemTag = pgTable("problem_tag", { + id: serial().primaryKey().notNull(), + name: text().notNull(), +}, (table) => [ + uniqueIndex("problem_tag_name_ci_unique").using("btree", sql`lower(name)`), +]); + +export const submission = pgTable("submission", { + id: text().primaryKey().notNull(), + contestId: integer("contest_id"), + problemId: integer("problem_id").notNull(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }).notNull(), + userId: integer("user_id").notNull(), + code: text().notNull(), + result: integer().default(6).notNull(), + info: jsonb().default({}).notNull(), + language: text().notNull(), + shared: boolean().default(false).notNull(), + statisticInfo: jsonb("statistic_info").default({}).notNull(), + username: text().notNull(), + ip: text(), +}, (table) => [ + index("contest_create_time_idx").using("btree", table.contestId.asc().nullsLast().op("timestamptz_ops"), table.createTime.desc().nullsFirst().op("int4_ops")), + index("problem_user_idx").using("btree", table.problemId.asc().nullsLast().op("int4_ops"), table.userId.asc().nullsLast().op("int4_ops")), + index("submission_contest_id_775716d5").using("btree", table.contestId.asc().nullsLast().op("int4_ops")), + index("submission_problem_id_76847b55").using("btree", table.problemId.asc().nullsLast().op("int4_ops")), + index("submission_result_37e2f67a").using("btree", table.result.asc().nullsLast().op("int4_ops")), + index("submission_user_id_3779a8c1").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + index("user_create_time_idx").using("btree", table.userId.asc().nullsLast().op("int4_ops"), table.createTime.asc().nullsLast().op("timestamptz_ops")), + foreignKey({ + columns: [table.contestId], + foreignColumns: [contest.id], + name: "submission_contest_id_775716d5_fk_contest_id" + }), + foreignKey({ + columns: [table.problemId], + foreignColumns: [problem.id], + name: "submission_problem_id_76847b55_fk_problem_id" + }), +]); + +export const tutorial = pgTable("tutorial", { + id: integer().primaryKey().generatedByDefaultAsIdentity({ name: "tutorial_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 2147483647, cache: 1 }), + title: varchar({ length: 128 }).notNull(), + content: text().notNull(), + createdAt: timestamp("created_at", { withTimezone: true, mode: 'string' }).notNull(), + updatedAt: timestamp("updated_at", { withTimezone: true, mode: 'string' }).notNull(), + isPublic: boolean("is_public").notNull(), + order: integer().notNull(), + createdById: integer("created_by_id").notNull(), + code: text(), + type: varchar({ length: 10 }).notNull(), +}, (table) => [ + index("tutorial_created_by_id_07973cab").using("btree", table.createdById.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.createdById], + foreignColumns: [user.id], + name: "tutorial_created_by_id_07973cab_fk_user_id" + }), +]); + +export const userStat = pgTable("user_stat", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "user_stat_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + metrics: jsonb().default({}).notNull(), + updateTime: timestamp("update_time", { withTimezone: true, mode: 'string' }).notNull(), + userId: integer("user_id").notNull(), +}, (table) => [ + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "user_stat_user_id_73337fc0_fk_user_id" + }), + unique("user_stat_user_id_key").on(table.userId), +]); + +export const userAchievement = pgTable("user_achievement", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "user_achievement_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + unlockTime: timestamp("unlock_time", { withTimezone: true, mode: 'string' }).notNull(), + backfilled: boolean().default(false).notNull(), + notified: boolean().default(false).notNull(), + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + achievementId: bigint("achievement_id", { mode: "number" }).notNull(), + userId: integer("user_id").notNull(), +}, (table) => [ + index("user_achievement_achievement_id_29db600d").using("btree", table.achievementId.asc().nullsLast().op("int8_ops")), + index("user_achievement_user_id_b8ec7d6a").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + index("user_achv_notified_idx").using("btree", table.userId.asc().nullsLast().op("int4_ops"), table.notified.asc().nullsLast().op("bool_ops")), + index("user_achv_time_idx").using("btree", table.userId.asc().nullsLast().op("int4_ops"), table.unlockTime.desc().nullsFirst().op("timestamptz_ops")), + foreignKey({ + columns: [table.achievementId], + foreignColumns: [achievement.id], + name: "user_achievement_achievement_id_29db600d_fk_achievement_id" + }), + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "user_achievement_user_id_b8ec7d6a_fk_user_id" + }), + unique("unique_user_achievement").on(table.achievementId, table.userId), +]); + +export const userBadge = pgTable("user_badge", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "user_badge_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + earnedTime: timestamp("earned_time", { withTimezone: true, mode: 'string' }).notNull(), + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + badgeId: bigint("badge_id", { mode: "number" }).notNull(), + userId: integer("user_id").notNull(), +}, (table) => [ + index("user_badge_badge_id_92a983e9").using("btree", table.badgeId.asc().nullsLast().op("int8_ops")), + index("user_badge_user_id_a286d718").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.badgeId], + foreignColumns: [problemsetBadge.id], + name: "user_badge_badge_id_92a983e9_fk_problemset_badge_id" + }), + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "user_badge_user_id_a286d718_fk_user_id" + }), + unique("unique_user_badge").on(table.badgeId, table.userId), +]); + +export const userProfile = pgTable("user_profile", { + id: serial().primaryKey().notNull(), + acmProblemsStatus: jsonb("acm_problems_status").default({}).notNull(), + avatar: text().notNull(), + blog: varchar({ length: 200 }), + mood: text(), + acceptedNumber: integer("accepted_number").default(0).notNull(), + submissionNumber: integer("submission_number").default(0).notNull(), + github: text(), + school: text(), + major: text(), + userId: integer("user_id").notNull(), + realName: text("real_name"), + language: text(), +}, (table) => [ + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "user_profile_user_id_8fdce8e2_fk_user_id" + }), + unique("user_profile_user_id_key").on(table.userId), +]); + +export const acmContestRank = pgTable("acm_contest_rank", { + id: serial().primaryKey().notNull(), + submissionNumber: integer("submission_number").default(0).notNull(), + acceptedNumber: integer("accepted_number").default(0).notNull(), + totalTime: integer("total_time").default(0).notNull(), + submissionInfo: jsonb("submission_info").default({}).notNull(), + contestId: integer("contest_id").notNull(), + userId: integer("user_id").notNull(), +}, (table) => [ + index("acm_contest_rank_contest_id_21030ccd").using("btree", table.contestId.asc().nullsLast().op("int4_ops")), + index("acm_contest_rank_user_id_40391ab2").using("btree", table.userId.asc().nullsLast().op("int4_ops")), + index("acm_rank_contest_user_idx").using("btree", table.contestId.asc().nullsLast().op("int4_ops"), table.userId.asc().nullsLast().op("int4_ops")), + index("acm_rank_order_idx").using("btree", table.contestId.asc().nullsLast().op("int4_ops"), table.acceptedNumber.asc().nullsLast().op("int4_ops"), table.totalTime.asc().nullsLast().op("int4_ops")), + foreignKey({ + columns: [table.contestId], + foreignColumns: [contest.id], + name: "acm_contest_rank_contest_id_21030ccd_fk_contest_id" + }), + foreignKey({ + columns: [table.userId], + foreignColumns: [user.id], + name: "acm_contest_rank_user_id_40391ab2_fk_user_id" + }), + unique("unique_acm_rank_user_contest").on(table.contestId, table.userId), +]); + +export const user = pgTable("user", { + id: serial().primaryKey().notNull(), + password: varchar({ length: 128 }).notNull(), + lastLogin: timestamp("last_login", { withTimezone: true, mode: 'string' }), + username: text().notNull(), + email: text(), + createTime: timestamp("create_time", { withTimezone: true, mode: 'string' }), + adminType: text("admin_type").notNull(), + authToken: text("auth_token"), + openApi: boolean("open_api").default(false).notNull(), + openApiAppkey: text("open_api_appkey"), + isDisabled: boolean("is_disabled").default(false).notNull(), + problemPermission: text("problem_permission").notNull(), + sessionKeys: jsonb("session_keys").default([]).notNull(), + rawPassword: varchar("raw_password", { length: 20 }), + className: text("class_name"), +}, (table) => [ + unique("user_username_key").on(table.username), +]); + +export const problemsetBadge = pgTable("problemset_badge", { + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + id: bigint({ mode: "number" }).primaryKey().generatedByDefaultAsIdentity({ name: "problemset_badge_id_seq", startWith: 1, increment: 1, minValue: 1, maxValue: 9223372036854775807, cache: 1 }), + name: text().notNull(), + description: text().notNull(), + icon: text().notNull(), + conditionType: text("condition_type").notNull(), + conditionValue: integer("condition_value").notNull(), + // You can use { mode: "bigint" } if numbers are exceeding js number limitations + problemsetId: bigint("problemset_id", { mode: "number" }).notNull(), +}, (table) => [ + index("problemset_badge_problemset_id_6cb6c74f").using("btree", table.problemsetId.asc().nullsLast().op("int8_ops")), + foreignKey({ + columns: [table.problemsetId], + foreignColumns: [problemset.id], + name: "problemset_badge_problemset_id_6cb6c74f_fk_problemset_id" + }), +]); diff --git a/apps/api/tsconfig.json b/apps/api/tsconfig.json new file mode 100644 index 0000000..cd30485 --- /dev/null +++ b/apps/api/tsconfig.json @@ -0,0 +1,4 @@ +{ + "extends": "../../tsconfig.base.json", + "include": ["src", "drizzle.config.ts"] +} diff --git a/bun.lock b/bun.lock index d21d3ac..f31ddda 100644 --- a/bun.lock +++ b/bun.lock @@ -9,6 +9,20 @@ "typescript": "^5.7.0", }, }, + "apps/api": { + "name": "@oj2/api", + "version": "0.0.0", + "dependencies": { + "@oj2/contract": "workspace:*", + "drizzle-orm": "^0.45.2", + "hono": "^4.0.0", + "postgres": "^3.4.0", + "zod": "^4.0.0", + }, + "devDependencies": { + "drizzle-kit": "^0.31.10", + }, + }, "packages/contract": { "name": "@oj2/contract", "version": "0.0.0", @@ -18,18 +32,202 @@ }, }, "packages": { + "@drizzle-team/brocli": ["@drizzle-team/brocli@0.10.2", "", {}, "sha512-z33Il7l5dKjUgGULTqBsQBQwckHh5AbIuxhdsIxDDiZAzBOrZO6q9ogcWC65kU382AfynTfgNumVcNIjuIua6w=="], + + "@esbuild-kit/core-utils": ["@esbuild-kit/core-utils@3.3.2", "", { "dependencies": { "esbuild": "~0.18.20", "source-map-support": "^0.5.21" } }, "sha512-sPRAnw9CdSsRmEtnsl2WXWdyquogVpB3yZ3dgwJfe8zrOzTsV7cJvmwrKVa+0ma5BoiGJ+BoqkMvawbayKUsqQ=="], + + "@esbuild-kit/esm-loader": ["@esbuild-kit/esm-loader@2.6.5", "", { "dependencies": { "@esbuild-kit/core-utils": "^3.3.2", "get-tsconfig": "^4.7.0" } }, "sha512-FxEMIkJKnodyA1OaCUoEvbYRkoZlLZ4d/eXFu9Fh8CbBBgP5EmZxrfTRyN0qpXZ4vOvqnE5YdRdcrmUUXuU+dA=="], + + "@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.25.12", "", { "os": "aix", "cpu": "ppc64" }, "sha512-Hhmwd6CInZ3dwpuGTF8fJG6yoWmsToE+vYgD4nytZVxcu1ulHpUQRAB1UJ8+N1Am3Mz4+xOByoQoSZf4D+CpkA=="], + + "@esbuild/android-arm": ["@esbuild/android-arm@0.25.12", "", { "os": "android", "cpu": "arm" }, "sha512-VJ+sKvNA/GE7Ccacc9Cha7bpS8nyzVv0jdVgwNDaR4gDMC/2TTRc33Ip8qrNYUcpkOHUT5OZ0bUcNNVZQ9RLlg=="], + + "@esbuild/android-arm64": ["@esbuild/android-arm64@0.25.12", "", { "os": "android", "cpu": "arm64" }, "sha512-6AAmLG7zwD1Z159jCKPvAxZd4y/VTO0VkprYy+3N2FtJ8+BQWFXU+OxARIwA46c5tdD9SsKGZ/1ocqBS/gAKHg=="], + + "@esbuild/android-x64": ["@esbuild/android-x64@0.25.12", "", { "os": "android", "cpu": "x64" }, "sha512-5jbb+2hhDHx5phYR2By8GTWEzn6I9UqR11Kwf22iKbNpYrsmRB18aX/9ivc5cabcUiAT/wM+YIZ6SG9QO6a8kg=="], + + "@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.25.12", "", { "os": "darwin", "cpu": "arm64" }, "sha512-N3zl+lxHCifgIlcMUP5016ESkeQjLj/959RxxNYIthIg+CQHInujFuXeWbWMgnTo4cp5XVHqFPmpyu9J65C1Yg=="], + + "@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.25.12", "", { "os": "darwin", "cpu": "x64" }, "sha512-HQ9ka4Kx21qHXwtlTUVbKJOAnmG1ipXhdWTmNXiPzPfWKpXqASVcWdnf2bnL73wgjNrFXAa3yYvBSd9pzfEIpA=="], + + "@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.25.12", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-gA0Bx759+7Jve03K1S0vkOu5Lg/85dou3EseOGUes8flVOGxbhDDh/iZaoek11Y8mtyKPGF3vP8XhnkDEAmzeg=="], + + "@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.25.12", "", { "os": "freebsd", "cpu": "x64" }, "sha512-TGbO26Yw2xsHzxtbVFGEXBFH0FRAP7gtcPE7P5yP7wGy7cXK2oO7RyOhL5NLiqTlBh47XhmIUXuGciXEqYFfBQ=="], + + "@esbuild/linux-arm": ["@esbuild/linux-arm@0.25.12", "", { "os": "linux", "cpu": "arm" }, "sha512-lPDGyC1JPDou8kGcywY0YILzWlhhnRjdof3UlcoqYmS9El818LLfJJc3PXXgZHrHCAKs/Z2SeZtDJr5MrkxtOw=="], + + "@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.25.12", "", { "os": "linux", "cpu": "arm64" }, "sha512-8bwX7a8FghIgrupcxb4aUmYDLp8pX06rGh5HqDT7bB+8Rdells6mHvrFHHW2JAOPZUbnjUpKTLg6ECyzvas2AQ=="], + + "@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.25.12", "", { "os": "linux", "cpu": "ia32" }, "sha512-0y9KrdVnbMM2/vG8KfU0byhUN+EFCny9+8g202gYqSSVMonbsCfLjUO+rCci7pM0WBEtz+oK/PIwHkzxkyharA=="], + + "@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.25.12", "", { "os": "linux", "cpu": "none" }, "sha512-h///Lr5a9rib/v1GGqXVGzjL4TMvVTv+s1DPoxQdz7l/AYv6LDSxdIwzxkrPW438oUXiDtwM10o9PmwS/6Z0Ng=="], + + "@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.25.12", "", { "os": "linux", "cpu": "none" }, "sha512-iyRrM1Pzy9GFMDLsXn1iHUm18nhKnNMWscjmp4+hpafcZjrr2WbT//d20xaGljXDBYHqRcl8HnxbX6uaA/eGVw=="], + + "@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.25.12", "", { "os": "linux", "cpu": "ppc64" }, "sha512-9meM/lRXxMi5PSUqEXRCtVjEZBGwB7P/D4yT8UG/mwIdze2aV4Vo6U5gD3+RsoHXKkHCfSxZKzmDssVlRj1QQA=="], + + "@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.25.12", "", { "os": "linux", "cpu": "none" }, "sha512-Zr7KR4hgKUpWAwb1f3o5ygT04MzqVrGEGXGLnj15YQDJErYu/BGg+wmFlIDOdJp0PmB0lLvxFIOXZgFRrdjR0w=="], + + "@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.25.12", "", { "os": "linux", "cpu": "s390x" }, "sha512-MsKncOcgTNvdtiISc/jZs/Zf8d0cl/t3gYWX8J9ubBnVOwlk65UIEEvgBORTiljloIWnBzLs4qhzPkJcitIzIg=="], + + "@esbuild/linux-x64": ["@esbuild/linux-x64@0.25.12", "", { "os": "linux", "cpu": "x64" }, "sha512-uqZMTLr/zR/ed4jIGnwSLkaHmPjOjJvnm6TVVitAa08SLS9Z0VM8wIRx7gWbJB5/J54YuIMInDquWyYvQLZkgw=="], + + "@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.25.12", "", { "os": "none", "cpu": "arm64" }, "sha512-xXwcTq4GhRM7J9A8Gv5boanHhRa/Q9KLVmcyXHCTaM4wKfIpWkdXiMog/KsnxzJ0A1+nD+zoecuzqPmCRyBGjg=="], + + "@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.25.12", "", { "os": "none", "cpu": "x64" }, "sha512-Ld5pTlzPy3YwGec4OuHh1aCVCRvOXdH8DgRjfDy/oumVovmuSzWfnSJg+VtakB9Cm0gxNO9BzWkj6mtO1FMXkQ=="], + + "@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.25.12", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-fF96T6KsBo/pkQI950FARU9apGNTSlZGsv1jZBAlcLL1MLjLNIWPBkj5NlSz8aAzYKg+eNqknrUJ24QBybeR5A=="], + + "@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.25.12", "", { "os": "openbsd", "cpu": "x64" }, "sha512-MZyXUkZHjQxUvzK7rN8DJ3SRmrVrke8ZyRusHlP+kuwqTcfWLyqMOE3sScPPyeIXN/mDJIfGXvcMqCgYKekoQw=="], + + "@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.25.12", "", { "os": "none", "cpu": "arm64" }, "sha512-rm0YWsqUSRrjncSXGA7Zv78Nbnw4XL6/dzr20cyrQf7ZmRcsovpcRBdhD43Nuk3y7XIoW2OxMVvwuRvk9XdASg=="], + + "@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.25.12", "", { "os": "sunos", "cpu": "x64" }, "sha512-3wGSCDyuTHQUzt0nV7bocDy72r2lI33QL3gkDNGkod22EsYl04sMf0qLb8luNKTOmgF/eDEDP5BFNwoBKH441w=="], + + "@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.25.12", "", { "os": "win32", "cpu": "arm64" }, "sha512-rMmLrur64A7+DKlnSuwqUdRKyd3UE7oPJZmnljqEptesKM8wx9J8gx5u0+9Pq0fQQW8vqeKebwNXdfOyP+8Bsg=="], + + "@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.25.12", "", { "os": "win32", "cpu": "ia32" }, "sha512-HkqnmmBoCbCwxUKKNPBixiWDGCpQGVsrQfJoVGYLPT41XWF8lHuE5N6WhVia2n4o5QK5M4tYr21827fNhi4byQ=="], + + "@esbuild/win32-x64": ["@esbuild/win32-x64@0.25.12", "", { "os": "win32", "cpu": "x64" }, "sha512-alJC0uCZpTFrSL0CCDjcgleBXPnCrEAhTBILpeAp7M/OFgoqtAetfBzX0xM00MUsVVPpVjlPuMbREqnZCXaTnA=="], + + "@oj2/api": ["@oj2/api@workspace:apps/api"], + "@oj2/contract": ["@oj2/contract@workspace:packages/contract"], - "@types/bun": ["@types/bun@1.3.14", "", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="], + "@types/bun": ["@types/bun@1.3.14", "https://registry.npmjs.com/@types/bun/-/bun-1.3.14.tgz", { "dependencies": { "bun-types": "1.3.14" } }, "sha512-h1hFqFVcvAvD9j9K7ZW7vd82aSA+rTdznZa+5bwvCwqSB1jmmfLcbIWhOLx1/+boy/xmjgCs/OMUL8hRJSmnPw=="], - "@types/node": ["@types/node@26.1.2", "", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg=="], + "@types/node": ["@types/node@26.1.2", "https://registry.npmjs.com/@types/node/-/node-26.1.2.tgz", { "dependencies": { "undici-types": "~8.3.0" } }, "sha512-Vu4a5UFA9rIIFJ7rB/Vaafh9lrCQszopTCx6KjFboXTGQbPNasehVR5TEiithSDGyd1DEiUByggTZsg8jukeIg=="], - "bun-types": ["bun-types@1.3.14", "", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="], + "buffer-from": ["buffer-from@1.1.2", "", {}, "sha512-E+XQCRwSbaaiChtv6k6Dwgc+bx+Bs6vuKJHHl5kox/BaKbhiXzqQOwK4cO22yElGp2OCmjwVhT3HmxgyPGnJfQ=="], - "typescript": ["typescript@5.9.3", "", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + "bun-types": ["bun-types@1.3.14", "https://registry.npmjs.com/bun-types/-/bun-types-1.3.14.tgz", { "dependencies": { "@types/node": "*" } }, "sha512-4N0ig0fEomHt5R0KCFWjovxow98rIoRwKolrYdCcknNwMekCXRnWEUvgu5soYV8QXtVsrUD8B95MBOZGPvr6KQ=="], - "undici-types": ["undici-types@8.3.0", "", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="], + "drizzle-kit": ["drizzle-kit@0.31.10", "", { "dependencies": { "@drizzle-team/brocli": "^0.10.2", "@esbuild-kit/esm-loader": "^2.5.5", "esbuild": "^0.25.4", "tsx": "^4.21.0" }, "bin": { "drizzle-kit": "bin.cjs" } }, "sha512-7OZcmQUrdGI+DUNNsKBn1aW8qSoKuTH7d0mYgSP8bAzdFzKoovxEFnoGQp2dVs82EOJeYycqRtciopszwUf8bw=="], - "zod": ["zod@4.4.3", "", {}, "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="], + "drizzle-orm": ["drizzle-orm@0.45.2", "", { "peerDependencies": { "@aws-sdk/client-rds-data": ">=3", "@cloudflare/workers-types": ">=4", "@electric-sql/pglite": ">=0.2.0", "@libsql/client": ">=0.10.0", "@libsql/client-wasm": ">=0.10.0", "@neondatabase/serverless": ">=0.10.0", "@op-engineering/op-sqlite": ">=2", "@opentelemetry/api": "^1.4.1", "@planetscale/database": ">=1.13", "@prisma/client": "*", "@tidbcloud/serverless": "*", "@types/better-sqlite3": "*", "@types/pg": "*", "@types/sql.js": "*", "@upstash/redis": ">=1.34.7", "@vercel/postgres": ">=0.8.0", "@xata.io/client": "*", "better-sqlite3": ">=7", "bun-types": "*", "expo-sqlite": ">=14.0.0", "gel": ">=2", "knex": "*", "kysely": "*", "mysql2": ">=2", "pg": ">=8", "postgres": ">=3", "sql.js": ">=1", "sqlite3": ">=5" }, "optionalPeers": ["@aws-sdk/client-rds-data", "@cloudflare/workers-types", "@electric-sql/pglite", "@libsql/client", "@libsql/client-wasm", "@neondatabase/serverless", "@op-engineering/op-sqlite", "@opentelemetry/api", "@planetscale/database", "@prisma/client", "@tidbcloud/serverless", "@types/better-sqlite3", "@types/pg", "@types/sql.js", "@upstash/redis", "@vercel/postgres", "@xata.io/client", "better-sqlite3", "bun-types", "expo-sqlite", "gel", "knex", "kysely", "mysql2", "pg", "postgres", "sql.js", "sqlite3"] }, "sha512-kY0BSaTNYWnoDMVoyY8uxmyHjpJW1geOmBMdSSicKo9CIIWkSxMIj2rkeSR51b8KAPB7m+qysjuHme5nKP+E5Q=="], + + "esbuild": ["esbuild@0.25.12", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.25.12", "@esbuild/android-arm": "0.25.12", "@esbuild/android-arm64": "0.25.12", "@esbuild/android-x64": "0.25.12", "@esbuild/darwin-arm64": "0.25.12", "@esbuild/darwin-x64": "0.25.12", "@esbuild/freebsd-arm64": "0.25.12", "@esbuild/freebsd-x64": "0.25.12", "@esbuild/linux-arm": "0.25.12", "@esbuild/linux-arm64": "0.25.12", "@esbuild/linux-ia32": "0.25.12", "@esbuild/linux-loong64": "0.25.12", "@esbuild/linux-mips64el": "0.25.12", "@esbuild/linux-ppc64": "0.25.12", "@esbuild/linux-riscv64": "0.25.12", "@esbuild/linux-s390x": "0.25.12", "@esbuild/linux-x64": "0.25.12", "@esbuild/netbsd-arm64": "0.25.12", "@esbuild/netbsd-x64": "0.25.12", "@esbuild/openbsd-arm64": "0.25.12", "@esbuild/openbsd-x64": "0.25.12", "@esbuild/openharmony-arm64": "0.25.12", "@esbuild/sunos-x64": "0.25.12", "@esbuild/win32-arm64": "0.25.12", "@esbuild/win32-ia32": "0.25.12", "@esbuild/win32-x64": "0.25.12" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-bbPBYYrtZbkt6Os6FiTLCTFxvq4tt3JKall1vRwshA3fdVztsLAatFaZobhkBC8/BrPetoa0oksYoKXoG4ryJg=="], + + "fsevents": ["fsevents@2.3.3", "", { "os": "darwin" }, "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw=="], + + "get-tsconfig": ["get-tsconfig@4.14.1", "", { "dependencies": { "resolve-pkg-maps": "^1.0.0" } }, "sha512-Dz/6HxkrxgNehhxLVeyv8sad9UzF2xBVeaKBQNDfJ5XiSXmp2gTR0eO0RWiT2NCKS5aGP9jjkOMggTN90qU50A=="], + + "hono": ["hono@4.13.0", "", {}, "sha512-jhunvfHWxd7J5EFfSgH4xsYJzSe/lfqbUCxiyyeaQasUsXeEHXtzVid+7EOGByc5JnFa23SSFL3Y2RV/z1T+eQ=="], + + "postgres": ["postgres@3.4.9", "", {}, "sha512-GD3qdB0x1z9xgFI6cdRD6xu2Sp2WCOEoe3mtnyB5Ee0XrrL5Pe+e4CCnJrRMnL1zYtRDZmQQVbvOttLnKDLnaw=="], + + "resolve-pkg-maps": ["resolve-pkg-maps@1.0.0", "", {}, "sha512-seS2Tj26TBVOC2NIc2rOe2y2ZO7efxITtLZcGSOnHHNOQ7CkiUBfw0Iw2ck6xkIhPwLhKNLS8BO+hEpngQlqzw=="], + + "source-map": ["source-map@0.6.1", "", {}, "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g=="], + + "source-map-support": ["source-map-support@0.5.21", "", { "dependencies": { "buffer-from": "^1.0.0", "source-map": "^0.6.0" } }, "sha512-uBHU3L3czsIyYXKX88fdrGovxdSCoTGDRZ6SYXtSRxLZUzHg5P/66Ht6uoUlHu9EZod+inXhKo3qQgwXUT/y1w=="], + + "tsx": ["tsx@4.23.9", "", { "dependencies": { "esbuild": "~0.28.0" }, "optionalDependencies": { "fsevents": "~2.3.3" }, "bin": { "tsx": "dist/cli.mjs" } }, "sha512-6q8uTORRGauQVjqMQnKUucLFoeXZAfw6zKvG35GLbdKWbLdeOtZ3H4mhyA5mxuUd2o2cRTskhj59nLLQseUvUw=="], + + "typescript": ["typescript@5.9.3", "https://registry.npmjs.com/typescript/-/typescript-5.9.3.tgz", { "bin": { "tsc": "bin/tsc", "tsserver": "bin/tsserver" } }, "sha512-jl1vZzPDinLr9eUt3J/t7V6FgNEw9QjvBPdysz9KfQDD41fQrC2Y4vKQdiaUpFT4bXlb1RHhLpp8wtm6M5TgSw=="], + + "undici-types": ["undici-types@8.3.0", "https://registry.npmjs.com/undici-types/-/undici-types-8.3.0.tgz", {}, "sha512-j375ScV60dom+YkPFIfTLcOiPxkN/buHz5GobjLhixFuANaNs3C9l4GmrWqejgXWJ7BbJcFYpTEUkS1Ge8bpZQ=="], + + "zod": ["zod@4.4.3", "https://registry.npmjs.com/zod/-/zod-4.4.3.tgz", {}, "sha512-ytENFjIJFl2UwYglde2jchW2Hwm4GJFLDiSXWdTrJQBIN9Fcyp7n4DhxJEiWNAJMV1/BqWfW/kkg71UDcHJyTQ=="], + + "@esbuild-kit/core-utils/esbuild": ["esbuild@0.18.20", "", { "optionalDependencies": { "@esbuild/android-arm": "0.18.20", "@esbuild/android-arm64": "0.18.20", "@esbuild/android-x64": "0.18.20", "@esbuild/darwin-arm64": "0.18.20", "@esbuild/darwin-x64": "0.18.20", "@esbuild/freebsd-arm64": "0.18.20", "@esbuild/freebsd-x64": "0.18.20", "@esbuild/linux-arm": "0.18.20", "@esbuild/linux-arm64": "0.18.20", "@esbuild/linux-ia32": "0.18.20", "@esbuild/linux-loong64": "0.18.20", "@esbuild/linux-mips64el": "0.18.20", "@esbuild/linux-ppc64": "0.18.20", "@esbuild/linux-riscv64": "0.18.20", "@esbuild/linux-s390x": "0.18.20", "@esbuild/linux-x64": "0.18.20", "@esbuild/netbsd-x64": "0.18.20", "@esbuild/openbsd-x64": "0.18.20", "@esbuild/sunos-x64": "0.18.20", "@esbuild/win32-arm64": "0.18.20", "@esbuild/win32-ia32": "0.18.20", "@esbuild/win32-x64": "0.18.20" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-ceqxoedUrcayh7Y7ZX6NdbbDzGROiyVBgC4PriJThBKSVPWnnFHZAkfI1lJT8QFkOwH4qOS2SJkS4wvpGl8BpA=="], + + "tsx/esbuild": ["esbuild@0.28.1", "", { "optionalDependencies": { "@esbuild/aix-ppc64": "0.28.1", "@esbuild/android-arm": "0.28.1", "@esbuild/android-arm64": "0.28.1", "@esbuild/android-x64": "0.28.1", "@esbuild/darwin-arm64": "0.28.1", "@esbuild/darwin-x64": "0.28.1", "@esbuild/freebsd-arm64": "0.28.1", "@esbuild/freebsd-x64": "0.28.1", "@esbuild/linux-arm": "0.28.1", "@esbuild/linux-arm64": "0.28.1", "@esbuild/linux-ia32": "0.28.1", "@esbuild/linux-loong64": "0.28.1", "@esbuild/linux-mips64el": "0.28.1", "@esbuild/linux-ppc64": "0.28.1", "@esbuild/linux-riscv64": "0.28.1", "@esbuild/linux-s390x": "0.28.1", "@esbuild/linux-x64": "0.28.1", "@esbuild/netbsd-arm64": "0.28.1", "@esbuild/netbsd-x64": "0.28.1", "@esbuild/openbsd-arm64": "0.28.1", "@esbuild/openbsd-x64": "0.28.1", "@esbuild/openharmony-arm64": "0.28.1", "@esbuild/sunos-x64": "0.28.1", "@esbuild/win32-arm64": "0.28.1", "@esbuild/win32-ia32": "0.28.1", "@esbuild/win32-x64": "0.28.1" }, "bin": { "esbuild": "bin/esbuild" } }, "sha512-HrJrvZv5ayxBzPfwphOoNzkzOIIlifzk0KJrGK2c8R4+LKpMtpYLQeUdjnwjWv/LZlkH2laZk+4w78pi99D4Vw=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.18.20", "", { "os": "android", "cpu": "arm" }, "sha512-fyi7TDI/ijKKNZTUJAQqiG5T7YjJXgnzkURqmGj13C6dCqckZBLdl4h7bkhHt/t0WP+zO9/zwroDvANaOqO5Sw=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/android-arm64": ["@esbuild/android-arm64@0.18.20", "", { "os": "android", "cpu": "arm64" }, "sha512-Nz4rJcchGDtENV0eMKUNa6L12zz2zBDXuhj/Vjh18zGqB44Bi7MBMSXjgunJgjRhCmKOjnPuZp4Mb6OKqtMHLQ=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/android-x64": ["@esbuild/android-x64@0.18.20", "", { "os": "android", "cpu": "x64" }, "sha512-8GDdlePJA8D6zlZYJV/jnrRAi6rOiNaCC/JclcXpB+KIuvfBN4owLtgzY2bsxnx666XjJx2kDPUmnTtR8qKQUg=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.18.20", "", { "os": "darwin", "cpu": "arm64" }, "sha512-bxRHW5kHU38zS2lPTPOyuyTm+S+eobPUnTNkdJEfAddYgEcll4xkT8DB9d2008DtTbl7uJag2HuE5NZAZgnNEA=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.18.20", "", { "os": "darwin", "cpu": "x64" }, "sha512-pc5gxlMDxzm513qPGbCbDukOdsGtKhfxD1zJKXjCCcU7ju50O7MeAZ8c4krSJcOIJGFR+qx21yMMVYwiQvyTyQ=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.18.20", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-yqDQHy4QHevpMAaxhhIwYPMv1NECwOvIpGCZkECn8w2WFHXjEwrBn3CeNIYsibZ/iZEUemj++M26W3cNR5h+Tw=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.18.20", "", { "os": "freebsd", "cpu": "x64" }, "sha512-tgWRPPuQsd3RmBZwarGVHZQvtzfEBOreNuxEMKFcd5DaDn2PbBxfwLcj4+aenoh7ctXcbXmOQIn8HI6mCSw5MQ=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/linux-arm": ["@esbuild/linux-arm@0.18.20", "", { "os": "linux", "cpu": "arm" }, "sha512-/5bHkMWnq1EgKr1V+Ybz3s1hWXok7mDFUMQ4cG10AfW3wL02PSZi5kFpYKrptDsgb2WAJIvRcDm+qIvXf/apvg=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.18.20", "", { "os": "linux", "cpu": "arm64" }, "sha512-2YbscF+UL7SQAVIpnWvYwM+3LskyDmPhe31pE7/aoTMFKKzIc9lLbyGUpmmb8a8AixOL61sQ/mFh3jEjHYFvdA=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.18.20", "", { "os": "linux", "cpu": "ia32" }, "sha512-P4etWwq6IsReT0E1KHU40bOnzMHoH73aXp96Fs8TIT6z9Hu8G6+0SHSw9i2isWrD2nbx2qo5yUqACgdfVGx7TA=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-nXW8nqBTrOpDLPgPY9uV+/1DjxoQ7DoB2N8eocyq8I9XuqJ7BiAMDMf9n1xZM9TgW0J8zrquIb/A7s3BJv7rjg=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-d5NeaXZcHp8PzYy5VnXV3VSd2D328Zb+9dEq5HE6bw6+N86JVPExrA6O68OPwobntbNJ0pzCpUFZTo3w0GyetQ=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.18.20", "", { "os": "linux", "cpu": "ppc64" }, "sha512-WHPyeScRNcmANnLQkq6AfyXRFr5D6N2sKgkFo2FqguP44Nw2eyDlbTdZwd9GYk98DZG9QItIiTlFLHJHjxP3FA=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.18.20", "", { "os": "linux", "cpu": "none" }, "sha512-WSxo6h5ecI5XH34KC7w5veNnKkju3zBRLEQNY7mv5mtBmrP/MjNBCAlsM2u5hDBlS3NGcTQpoBvRzqBcRtpq1A=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.18.20", "", { "os": "linux", "cpu": "s390x" }, "sha512-+8231GMs3mAEth6Ja1iK0a1sQ3ohfcpzpRLH8uuc5/KVDFneH6jtAJLFGafpzpMRO6DzJ6AvXKze9LfFMrIHVQ=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/linux-x64": ["@esbuild/linux-x64@0.18.20", "", { "os": "linux", "cpu": "x64" }, "sha512-UYqiqemphJcNsFEskc73jQ7B9jgwjWrSayxawS6UVFZGWrAAtkzjxSqnoclCXxWtfwLdzU+vTpcNYhpn43uP1w=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.18.20", "", { "os": "none", "cpu": "x64" }, "sha512-iO1c++VP6xUBUmltHZoMtCUdPlnPGdBom6IrO4gyKPFFVBKioIImVooR5I83nTew5UOYrk3gIJhbZh8X44y06A=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.18.20", "", { "os": "openbsd", "cpu": "x64" }, "sha512-e5e4YSsuQfX4cxcygw/UCPIEP6wbIL+se3sxPdCiMbFLBWu0eiZOJ7WoD+ptCLrmjZBK1Wk7I6D/I3NglUGOxg=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.18.20", "", { "os": "sunos", "cpu": "x64" }, "sha512-kDbFRFp0YpTQVVrqUd5FTYmWo45zGaXe0X8E1G/LKFC0v8x0vWrhOWSLITcCn63lmZIxfOMXtCfti/RxN/0wnQ=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.18.20", "", { "os": "win32", "cpu": "arm64" }, "sha512-ddYFR6ItYgoaq4v4JmQQaAI5s7npztfV4Ag6NrhiaW0RrnOXqBkgwZLofVTlq1daVTQNhtI5oieTvkRPfZrePg=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.18.20", "", { "os": "win32", "cpu": "ia32" }, "sha512-Wv7QBi3ID/rROT08SABTS7eV4hX26sVduqDOTe1MvGMjNd3EjOz4b7zeexIR62GTIEKrfJXKL9LFxTYgkyeu7g=="], + + "@esbuild-kit/core-utils/esbuild/@esbuild/win32-x64": ["@esbuild/win32-x64@0.18.20", "", { "os": "win32", "cpu": "x64" }, "sha512-kTdfRcSiDfQca/y9QIkng02avJ+NCaQvrMejlsB3RRv5sE9rRoeBPISaZpKxHELzRxZyLvNts1P27W3wV+8geQ=="], + + "tsx/esbuild/@esbuild/aix-ppc64": ["@esbuild/aix-ppc64@0.28.1", "", { "os": "aix", "cpu": "ppc64" }, "sha512-Svl7tq8k/08+p6CXPpRjQ1fKX+1odH/BQbb48fV6fj3CWHhsoIOoY87w1oHXm0qEpkIK3ZfVgp0hed3XBXzXMQ=="], + + "tsx/esbuild/@esbuild/android-arm": ["@esbuild/android-arm@0.28.1", "", { "os": "android", "cpu": "arm" }, "sha512-0k2F129Xdio1TdJfzJ8sy1Q47vUD2NnwdhiAf7drUN1EBTfPf4hsFCtmMgu/6m8JSzsBrlmVjudMBQqOfG8usQ=="], + + "tsx/esbuild/@esbuild/android-arm64": ["@esbuild/android-arm64@0.28.1", "", { "os": "android", "cpu": "arm64" }, "sha512-34EGEbCIAgosYz6goLcopX6Mo7NyGv9tfwEM2/7Ce2VcVRk568iSvniGWcUXIy7wEDR1wzolcxcriFVrWYcwBg=="], + + "tsx/esbuild/@esbuild/android-x64": ["@esbuild/android-x64@0.28.1", "", { "os": "android", "cpu": "x64" }, "sha512-dbwY7ltSMDWsRatcRpCnES4F+im88OCUgGZjy52shC7GqHRE/cYlxNbB4Z4UpJswpcc4Qxd2oE/ufM0p61IKng=="], + + "tsx/esbuild/@esbuild/darwin-arm64": ["@esbuild/darwin-arm64@0.28.1", "", { "os": "darwin", "cpu": "arm64" }, "sha512-TZbWkQY7kvTAXbXUT7uVACR5cMHsDiSz9z7ZKAX/RTq/WJEk3QyRr0wZpNhBDX+/0CtdqUIJlOiodQcta6tY3Q=="], + + "tsx/esbuild/@esbuild/darwin-x64": ["@esbuild/darwin-x64@0.28.1", "", { "os": "darwin", "cpu": "x64" }, "sha512-zfdzgK9ACBNZLI/CyHTOx81SyNbM6YXn7rxSgX97VjyiPl9W1i4Ka4fgKECEoFCKGpvBj5qArWIGgQjOwkgskQ=="], + + "tsx/esbuild/@esbuild/freebsd-arm64": ["@esbuild/freebsd-arm64@0.28.1", "", { "os": "freebsd", "cpu": "arm64" }, "sha512-wG2EA8ENdEI0qhkSZMjfqrdY+ziCYCPMmtZjjIwOmXFjmyzEHn+UUxk5of+SYsjtfs3VpnlC7QLzSI5hY/rOAw=="], + + "tsx/esbuild/@esbuild/freebsd-x64": ["@esbuild/freebsd-x64@0.28.1", "", { "os": "freebsd", "cpu": "x64" }, "sha512-i7dZ9vQgnvSCzi/rYCXNgtF/U+eKZNJBzu3eTQbRgHnM7tNSizLOkRFAl3qzVc/Op/u5YkHHa4pf/3DOYHthLQ=="], + + "tsx/esbuild/@esbuild/linux-arm": ["@esbuild/linux-arm@0.28.1", "", { "os": "linux", "cpu": "arm" }, "sha512-qVXBOHQS+d5Y722GwJzJUtOLlX7km3CraOaGormF1pDtPd2C/l1SHRPgjLunLGe51Sh5YYWKMFDyV4SxgMQYTQ=="], + + "tsx/esbuild/@esbuild/linux-arm64": ["@esbuild/linux-arm64@0.28.1", "", { "os": "linux", "cpu": "arm64" }, "sha512-yHs+0uc8+nvEAfAfxrWQKK5peSNzBc4PegcMO0EJ2hT71uA7vB8Ihg2e77R2P7SG5uYjPbHlLLmve4LLLRCf0g=="], + + "tsx/esbuild/@esbuild/linux-ia32": ["@esbuild/linux-ia32@0.28.1", "", { "os": "linux", "cpu": "ia32" }, "sha512-d1z4ZuP0ajrfz/FhGT4vv278rX8KnPPJx8i5+AtK7TYbx9Le9F1hyzurZpkEyjkGa9dUGhQow4C1NmeGvqxN2w=="], + + "tsx/esbuild/@esbuild/linux-loong64": ["@esbuild/linux-loong64@0.28.1", "", { "os": "linux", "cpu": "none" }, "sha512-M5sRjUVZrkm1OAPR3dlOYzNmN+loZKGVi1VUQGrwuqLcbR6qeAz+famMhjASeH3YVKvZz+zT1jlh/keC3Rj/lg=="], + + "tsx/esbuild/@esbuild/linux-mips64el": ["@esbuild/linux-mips64el@0.28.1", "", { "os": "linux", "cpu": "none" }, "sha512-mRObBZeHh2OxcBFPWE/FjylkRgZdYuiTR3vaTozquCGOH14iP9oN4x4Ge81CoIDYQrXmIxpFumJBu5MtZpnQJQ=="], + + "tsx/esbuild/@esbuild/linux-ppc64": ["@esbuild/linux-ppc64@0.28.1", "", { "os": "linux", "cpu": "ppc64" }, "sha512-slScBsMAb3GFDcdrCgLwZtPYRoH2H/youv10QiZyRjmsP48fznoveWytSgCI/R0ZcUgpc0ZhIUEx6LHts8yrfQ=="], + + "tsx/esbuild/@esbuild/linux-riscv64": ["@esbuild/linux-riscv64@0.28.1", "", { "os": "linux", "cpu": "none" }, "sha512-kw0owk1o0GFETUJyW0jc0G4Yzs0BHZn0JDZ8JRT088vjJYX777BAs1fDGxAC+q831qOs2DTC96mNsG2opdfyyQ=="], + + "tsx/esbuild/@esbuild/linux-s390x": ["@esbuild/linux-s390x@0.28.1", "", { "os": "linux", "cpu": "s390x" }, "sha512-/lAIjX8aYFRByhh6L5rYtPEDRqa9de/4V/juOXcta5frjvzXO4/sqEtyytse0g3zZFuWu5cDN0MkLz2qRDD2Ag=="], + + "tsx/esbuild/@esbuild/linux-x64": ["@esbuild/linux-x64@0.28.1", "", { "os": "linux", "cpu": "x64" }, "sha512-u/anNYF2mmVOEDwLtnQ1wOr3EZ9sTNGLWrsYGYwHWzGA3Si84IOkHXlbWTD1NB+9/1lcnweYKO54uhxZydNzfA=="], + + "tsx/esbuild/@esbuild/netbsd-arm64": ["@esbuild/netbsd-arm64@0.28.1", "", { "os": "none", "cpu": "arm64" }, "sha512-oks0DYbLwWMmaakTsCb+zL4E+aHRVLom9IJZOAthMQEPiQmydXHkziYEsGYRx0uNV/IjEKGAV941JzH02pflqw=="], + + "tsx/esbuild/@esbuild/netbsd-x64": ["@esbuild/netbsd-x64@0.28.1", "", { "os": "none", "cpu": "x64" }, "sha512-aeL6lAnN89Hz43Mlh1G8ARasbuoYvSITDEx0tHh5b7jJnHcssqgjy9Yx430GDpmCa6OyrKoS0aNRjKundRizGg=="], + + "tsx/esbuild/@esbuild/openbsd-arm64": ["@esbuild/openbsd-arm64@0.28.1", "", { "os": "openbsd", "cpu": "arm64" }, "sha512-MEFJe5C3R8pwXdZ5Y21oo6m7ePiS0d9pWucn99O/wvyJZChoIQKrQDxKrGeW8F5+T0okTHesAmDeiHDTIq0V/Q=="], + + "tsx/esbuild/@esbuild/openbsd-x64": ["@esbuild/openbsd-x64@0.28.1", "", { "os": "openbsd", "cpu": "x64" }, "sha512-i/ZLIOafE0Z8cI/XANJAixoJL/uRAoS2xOA3rb0xN+KK0K177cMAsQYkzHtBrtMXAKuAc7HGgcWiZ/sRC1Nxgw=="], + + "tsx/esbuild/@esbuild/openharmony-arm64": ["@esbuild/openharmony-arm64@0.28.1", "", { "os": "none", "cpu": "arm64" }, "sha512-ge+Z7EXFNt2BO1oAMsVpiQ8EwndV9i1xXerAeTIK7AtPs3bKFXQM7nlRxDSIUIMeueR1CNXxqztLzdNeReKBJg=="], + + "tsx/esbuild/@esbuild/sunos-x64": ["@esbuild/sunos-x64@0.28.1", "", { "os": "sunos", "cpu": "x64" }, "sha512-BEjgtECkL3vY+SaSQ6nzVfiALUeFxpawyp8Jmf5PtYhf1Ug40N1h/hxlhts+f1FvSvarEigdxS3BlSMI2PJLcQ=="], + + "tsx/esbuild/@esbuild/win32-arm64": ["@esbuild/win32-arm64@0.28.1", "", { "os": "win32", "cpu": "arm64" }, "sha512-lCv9eK/H6ZJWbE7bh2nw54CZ9M2nupBxJcTsdk/QQnWkdSjKGuxmmH8/GWrlT1eMmZfn4dGcCjRte397WqfQXA=="], + + "tsx/esbuild/@esbuild/win32-ia32": ["@esbuild/win32-ia32@0.28.1", "", { "os": "win32", "cpu": "ia32" }, "sha512-zvb/mB2bSCoJOpoCBgYKKpX6YM6mJBlBUVUtVj41DlZJVEB6/0CKlRYxP5wWl1C1ILiCoAU5wZZ4q1P3qeS6Eg=="], + + "tsx/esbuild/@esbuild/win32-x64": ["@esbuild/win32-x64@0.28.1", "", { "os": "win32", "cpu": "x64" }, "sha512-bm4Mowrv+GXMlpWX++EcXw/iLyd1o3+bJkC2DkWXYVvgZCqD/bSj9ctZeAMC3cIxgjRVR2Dufaiu4YPxr5gW1A=="], } }