diff --git a/.gitignore b/.gitignore index 26c2873..23a326f 100644 --- a/.gitignore +++ b/.gitignore @@ -7,4 +7,7 @@ public/app/ .claude/ .env.test logs/ -.codegraph/ \ No newline at end of file +.codegraph/ +# moon +.moon/cache +.moon/docker diff --git a/.moon/workspace.yml b/.moon/workspace.yml new file mode 100644 index 0000000..5829b56 --- /dev/null +++ b/.moon/workspace.yml @@ -0,0 +1,8 @@ +# Moon Workspace Configuration +projects: + - 'services/*' + - 'packages/*' + +vcs: + defaultBranch: main + provider: github diff --git a/drizzle/migrations/0000_rare_kitty_pryde.sql b/drizzle/migrations/0000_rare_kitty_pryde.sql deleted file mode 100644 index fb708f0..0000000 --- a/drizzle/migrations/0000_rare_kitty_pryde.sql +++ /dev/null @@ -1,69 +0,0 @@ -CREATE TABLE "attachments" ( - "id" text PRIMARY KEY NOT NULL, - "message_id" text NOT NULL, - "guild_id" text NOT NULL, - "channel_id" text NOT NULL, - "thread_id" text, - "user_id" text NOT NULL, - "filename" text NOT NULL, - "size" integer NOT NULL, - "type" text NOT NULL, - "discord_url" text NOT NULL, - "uploaded_url" text, - "upload_status" text DEFAULT 'pending' NOT NULL, - "upload_error" text, - "created_at" bigint NOT NULL, - "uploaded_at" bigint -); ---> statement-breakpoint -CREATE TABLE "messages" ( - "id" text PRIMARY KEY NOT NULL, - "guild_id" text NOT NULL, - "channel_id" text NOT NULL, - "thread_id" text, - "user_id" text NOT NULL, - "username" text NOT NULL, - "avatar_url" text, - "content" text NOT NULL, - "edited_content" text, - "created_at" bigint NOT NULL, - "edited_at" bigint, - "deleted_at" bigint, - "type" text DEFAULT 'text' NOT NULL, - "metadata" text, - "ai_status" text DEFAULT 'pending' NOT NULL, - "ai_moderation_flags" text, - "ai_moderation_score" real, - "ai_moderation_raw" text, - "ai_analysis" text, - "ai_analyzed_at" bigint, - "ai_error" text -); ---> statement-breakpoint -CREATE TABLE "muxer_jobs" ( - "id" text PRIMARY KEY NOT NULL, - "data" text NOT NULL, - "status" text DEFAULT 'pending' NOT NULL, - "attempts" integer DEFAULT 0 NOT NULL, - "maxAttempts" integer DEFAULT 3 NOT NULL, - "createdAt" bigint NOT NULL, - "updatedAt" bigint NOT NULL, - "error" text -); ---> statement-breakpoint -CREATE TABLE "ui_state" ( - "key" text PRIMARY KEY NOT NULL, - "value" text NOT NULL, - "updated_at" bigint NOT NULL -); ---> statement-breakpoint -ALTER TABLE "attachments" ADD CONSTRAINT "fk_attachments_message_id" FOREIGN KEY ("message_id") REFERENCES "public"."messages"("id") ON DELETE cascade ON UPDATE no action;--> statement-breakpoint -CREATE INDEX "idx_attachments_channel" ON "attachments" USING btree ("channel_id");--> statement-breakpoint -CREATE INDEX "idx_attachments_message" ON "attachments" USING btree ("message_id");--> statement-breakpoint -CREATE INDEX "idx_attachments_status" ON "attachments" USING btree ("upload_status");--> statement-breakpoint -CREATE INDEX "idx_messages_channel" ON "messages" USING btree ("channel_id");--> statement-breakpoint -CREATE INDEX "idx_messages_user" ON "messages" USING btree ("user_id");--> statement-breakpoint -CREATE INDEX "idx_messages_created" ON "messages" USING btree ("created_at");--> statement-breakpoint -CREATE INDEX "idx_messages_thread" ON "messages" USING btree ("thread_id");--> statement-breakpoint -CREATE INDEX "idx_muxer_jobs_status" ON "muxer_jobs" USING btree ("status");--> statement-breakpoint -CREATE INDEX "idx_muxer_jobs_createdAt" ON "muxer_jobs" USING btree ("createdAt"); \ No newline at end of file diff --git a/drizzle/migrations/0001_curious_zodiak.sql b/drizzle/migrations/0001_curious_zodiak.sql deleted file mode 100644 index d2d976c..0000000 --- a/drizzle/migrations/0001_curious_zodiak.sql +++ /dev/null @@ -1,22 +0,0 @@ -CREATE TABLE "ai_analysis_runs" ( - "id" text PRIMARY KEY NOT NULL, - "conversation_key" text NOT NULL, - "target_message_ids" text NOT NULL, - "model" text NOT NULL, - "request_tokens_estimate" integer, - "response_raw" text, - "status" text DEFAULT 'pending' NOT NULL, - "error" text, - "created_at" bigint NOT NULL, - "completed_at" bigint -); ---> statement-breakpoint -CREATE INDEX "idx_ai_analysis_runs_conversation_key" ON "ai_analysis_runs" ("conversation_key");--> statement-breakpoint -CREATE INDEX "idx_ai_analysis_runs_status" ON "ai_analysis_runs" ("status");--> statement-breakpoint -CREATE INDEX "idx_ai_analysis_runs_created_at" ON "ai_analysis_runs" ("created_at");--> statement-breakpoint -CREATE INDEX "idx_attachments_channel_created" ON "attachments" ("channel_id","created_at","id");--> statement-breakpoint -CREATE INDEX "idx_attachments_thread_created" ON "attachments" ("thread_id","created_at","id");--> statement-breakpoint -CREATE INDEX "idx_messages_channel_created" ON "messages" ("channel_id","created_at","id");--> statement-breakpoint -CREATE INDEX "idx_messages_thread_created" ON "messages" ("thread_id","created_at","id");--> statement-breakpoint -CREATE INDEX "idx_messages_ai_status_created" ON "messages" ("ai_status","created_at","id");--> statement-breakpoint -CREATE INDEX "idx_messages_guild_ai_status_created" ON "messages" ("guild_id","ai_status","created_at","id"); \ No newline at end of file diff --git a/drizzle/migrations/0002_dark_omega_flight.sql b/drizzle/migrations/0002_dark_omega_flight.sql deleted file mode 100644 index 2efc326..0000000 --- a/drizzle/migrations/0002_dark_omega_flight.sql +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE "voice_recordings" ( - "id" text PRIMARY KEY NOT NULL, - "user_id" text NOT NULL, - "username" text NOT NULL, - "avatar_url" text, - "guild_id" text, - "channel_id" text, - "channel_name" text, - "filename" text NOT NULL, - "size_bytes" integer NOT NULL, - "download_url" text, - "upload_status" text DEFAULT 'pending' NOT NULL, - "upload_error" text, - "created_at" bigint NOT NULL, - "uploaded_at" bigint -); ---> statement-breakpoint -CREATE INDEX "idx_voice_recordings_user_id" ON "voice_recordings" USING btree ("user_id");--> statement-breakpoint -CREATE INDEX "idx_voice_recordings_channel_id" ON "voice_recordings" USING btree ("channel_id");--> statement-breakpoint -CREATE INDEX "idx_voice_recordings_created_at" ON "voice_recordings" USING btree ("created_at"); \ No newline at end of file diff --git a/drizzle/migrations/0003_ai_moderation_review_guardrails.sql b/drizzle/migrations/0003_ai_moderation_review_guardrails.sql deleted file mode 100644 index 4707c9e..0000000 --- a/drizzle/migrations/0003_ai_moderation_review_guardrails.sql +++ /dev/null @@ -1,65 +0,0 @@ -ALTER TABLE "messages" ADD COLUMN IF NOT EXISTS "ai_categories" text; ---> statement-breakpoint -ALTER TABLE "messages" ADD COLUMN IF NOT EXISTS "ai_severity" text; ---> statement-breakpoint -ALTER TABLE "messages" ADD COLUMN IF NOT EXISTS "ai_confidence" real; ---> statement-breakpoint -ALTER TABLE "messages" ADD COLUMN IF NOT EXISTS "ai_recommended_action" text; ---> statement-breakpoint -ALTER TABLE "messages" ADD COLUMN IF NOT EXISTS "ai_policy_version" text; ---> statement-breakpoint -ALTER TABLE "messages" ADD COLUMN IF NOT EXISTS "ai_evidence" text; ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "message_reviews" ( - "id" text PRIMARY KEY NOT NULL, - "message_id" text NOT NULL, - "guild_id" text NOT NULL, - "channel_id" text NOT NULL, - "reviewer_id" text, - "status" text DEFAULT 'pending' NOT NULL, - "notes" text, - "created_at" bigint NOT NULL, - "reviewed_at" bigint -); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_message_reviews_message_id" ON "message_reviews" USING btree ("message_id"); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_message_reviews_guild_status" ON "message_reviews" USING btree ("guild_id", "status", "created_at"); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "moderation_actions" ( - "id" text PRIMARY KEY NOT NULL, - "message_id" text, - "user_id" text, - "guild_id" text NOT NULL, - "action_type" text NOT NULL, - "reason" text, - "executed_by" text, - "status" text DEFAULT 'pending' NOT NULL, - "error" text, - "created_at" bigint NOT NULL, - "executed_at" bigint -); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_moderation_actions_message_id" ON "moderation_actions" USING btree ("message_id"); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_moderation_actions_user_id" ON "moderation_actions" USING btree ("user_id"); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_moderation_actions_status" ON "moderation_actions" USING btree ("status"); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_moderation_actions_guild_status" ON "moderation_actions" USING btree ("guild_id", "status", "created_at"); ---> statement-breakpoint -CREATE TABLE IF NOT EXISTS "retention_policies" ( - "id" text PRIMARY KEY NOT NULL, - "guild_id" text NOT NULL, - "channel_id" text, - "retention_days" integer DEFAULT 90 NOT NULL, - "apply_to_media" boolean DEFAULT true NOT NULL, - "apply_to_voice" boolean DEFAULT true NOT NULL, - "enabled" boolean DEFAULT true NOT NULL, - "created_at" bigint NOT NULL, - "updated_at" bigint NOT NULL -); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_retention_policies_guild_id" ON "retention_policies" USING btree ("guild_id"); ---> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_retention_policies_enabled" ON "retention_policies" USING btree ("enabled"); diff --git a/drizzle/migrations/0004_analytics_perf_indexes.sql b/drizzle/migrations/0004_analytics_perf_indexes.sql deleted file mode 100644 index 7c94b5c..0000000 --- a/drizzle/migrations/0004_analytics_perf_indexes.sql +++ /dev/null @@ -1,16 +0,0 @@ --- Add composite index for analytics queries: every analytics query filters by --- guild_id + created_at range + deleted_at IS NULL. --- This single index covers getHourlyStats, getTopicTrends, getUserLeaderboard, --- getModerationStats, getActiveChannelCount, and getTopViolators. -CREATE INDEX IF NOT EXISTS "idx_messages_guild_created" - ON "messages" USING btree ("guild_id", "created_at"); - --- Covering index for analytics queries that also filter by ai_status --- (flagged/warn/clean counts). This speeds up the GROUP BY ai_status aggregates. -CREATE INDEX IF NOT EXISTS "idx_messages_guild_status_created" - ON "messages" USING btree ("guild_id", "ai_status", "created_at"); - --- Composite index for channel-scoped analytics queries --- Covers channel_id + thread_id OR filters used when a specific channel is selected -CREATE INDEX IF NOT EXISTS "idx_messages_guild_channel_created" - ON "messages" USING btree ("guild_id", "channel_id", "created_at"); diff --git a/drizzle/migrations/0005_optimize-message-index.sql b/drizzle/migrations/0005_optimize-message-index.sql deleted file mode 100644 index c656ca8..0000000 --- a/drizzle/migrations/0005_optimize-message-index.sql +++ /dev/null @@ -1,3 +0,0 @@ -CREATE INDEX IF NOT EXISTS "idx_messages_guild_created_deleted" ON "messages" USING btree ("guild_id","created_at","deleted_at","id");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_messages_channel_ai_status_created" ON "messages" USING btree ("channel_id","ai_status","created_at","id");--> statement-breakpoint -CREATE INDEX IF NOT EXISTS "idx_messages_thread_ai_status_created" ON "messages" USING btree ("thread_id","ai_status","created_at","id"); diff --git a/drizzle/migrations/0006_fix_text_analysis_cache_source.sql b/drizzle/migrations/0006_fix_text_analysis_cache_source.sql deleted file mode 100644 index e3276b5..0000000 --- a/drizzle/migrations/0006_fix_text_analysis_cache_source.sql +++ /dev/null @@ -1,2 +0,0 @@ -ALTER TABLE "text_analysis_cache" DROP CONSTRAINT IF EXISTS "text_analysis_cache_source_check";--> statement-breakpoint -ALTER TABLE "text_analysis_cache" ADD CONSTRAINT "text_analysis_cache_source_check" CHECK ("source" IN ('local', 'nvidia', 'primary_ai', 'groq', 'vision_llm'));--> statement-breakpoint \ No newline at end of file diff --git a/drizzle/migrations/0007_black_nova.sql b/drizzle/migrations/0007_black_nova.sql deleted file mode 100644 index 4b5de2b..0000000 --- a/drizzle/migrations/0007_black_nova.sql +++ /dev/null @@ -1,20 +0,0 @@ -CREATE TABLE "sticker_cache" ( - "name" text PRIMARY KEY NOT NULL, - "base64" text NOT NULL, - "mime_type" text NOT NULL, - "size" integer NOT NULL, - "fetched_at" bigint NOT NULL -); ---> statement-breakpoint -CREATE TABLE "text_analysis_cache" ( - "text" text PRIMARY KEY NOT NULL, - "flags" text DEFAULT '[]' NOT NULL, - "source" text DEFAULT 'local' NOT NULL, - "analyzed_at" bigint NOT NULL, - "expires_at" bigint NOT NULL, - "hit_count" integer DEFAULT 0 NOT NULL -); ---> statement-breakpoint -CREATE INDEX "idx_sticker_cache_fetched_at" ON "sticker_cache" USING btree ("fetched_at");--> statement-breakpoint -CREATE INDEX "idx_text_analysis_cache_expires_at" ON "text_analysis_cache" USING btree ("expires_at");--> statement-breakpoint -CREATE INDEX "idx_text_analysis_cache_source" ON "text_analysis_cache" USING btree ("source"); \ No newline at end of file diff --git a/drizzle/migrations/meta/0000_snapshot.json b/drizzle/migrations/meta/0000_snapshot.json deleted file mode 100644 index 7785493..0000000 --- a/drizzle/migrations/meta/0000_snapshot.json +++ /dev/null @@ -1,511 +0,0 @@ -{ - "id": "2b9e2347-dd99-4bf8-bbcb-f407af29ca83", - "prevId": "00000000-0000-0000-0000-000000000000", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.attachments": { - "name": "attachments", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filename": { - "name": "filename", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size": { - "name": "size", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "discord_url": { - "name": "discord_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "uploaded_url": { - "name": "uploaded_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "upload_status": { - "name": "upload_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "upload_error": { - "name": "upload_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "uploaded_at": { - "name": "uploaded_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_attachments_channel": { - "name": "idx_attachments_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_message": { - "name": "idx_attachments_message", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_status": { - "name": "idx_attachments_status", - "columns": [ - { - "expression": "upload_status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "fk_attachments_message_id": { - "name": "fk_attachments_message_id", - "tableFrom": "attachments", - "tableTo": "messages", - "columnsFrom": [ - "message_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.messages": { - "name": "messages", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "edited_content": { - "name": "edited_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "edited_at": { - "name": "edited_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_status": { - "name": "ai_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "ai_moderation_flags": { - "name": "ai_moderation_flags", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_moderation_score": { - "name": "ai_moderation_score", - "type": "real", - "primaryKey": false, - "notNull": false - }, - "ai_moderation_raw": { - "name": "ai_moderation_raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_analysis": { - "name": "ai_analysis", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_analyzed_at": { - "name": "ai_analyzed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "ai_error": { - "name": "ai_error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_messages_channel": { - "name": "idx_messages_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_user": { - "name": "idx_messages_user", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_created": { - "name": "idx_messages_created", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread": { - "name": "idx_messages_thread", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.muxer_jobs": { - "name": "muxer_jobs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "data": { - "name": "data", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "maxAttempts": { - "name": "maxAttempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 3 - }, - "createdAt": { - "name": "createdAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "updatedAt": { - "name": "updatedAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_muxer_jobs_status": { - "name": "idx_muxer_jobs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_muxer_jobs_createdAt": { - "name": "idx_muxer_jobs_createdAt", - "columns": [ - { - "expression": "createdAt", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ui_state": { - "name": "ui_state", - "schema": "", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/migrations/meta/0001_snapshot.json b/drizzle/migrations/meta/0001_snapshot.json deleted file mode 100644 index cbc6990..0000000 --- a/drizzle/migrations/meta/0001_snapshot.json +++ /dev/null @@ -1,799 +0,0 @@ -{ - "id": "79348c3a-b314-4bfd-88f3-7ddfbea4427e", - "prevId": "2b9e2347-dd99-4bf8-bbcb-f407af29ca83", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ai_analysis_runs": { - "name": "ai_analysis_runs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "conversation_key": { - "name": "conversation_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "target_message_ids": { - "name": "target_message_ids", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "request_tokens_estimate": { - "name": "request_tokens_estimate", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "response_raw": { - "name": "response_raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "completed_at": { - "name": "completed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_ai_analysis_runs_conversation_key": { - "name": "idx_ai_analysis_runs_conversation_key", - "columns": [ - { - "expression": "conversation_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_ai_analysis_runs_status": { - "name": "idx_ai_analysis_runs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_ai_analysis_runs_created_at": { - "name": "idx_ai_analysis_runs_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.attachments": { - "name": "attachments", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filename": { - "name": "filename", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size": { - "name": "size", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "discord_url": { - "name": "discord_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "uploaded_url": { - "name": "uploaded_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "upload_status": { - "name": "upload_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "upload_error": { - "name": "upload_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "uploaded_at": { - "name": "uploaded_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_attachments_channel": { - "name": "idx_attachments_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_message": { - "name": "idx_attachments_message", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_status": { - "name": "idx_attachments_status", - "columns": [ - { - "expression": "upload_status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_channel_created": { - "name": "idx_attachments_channel_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_thread_created": { - "name": "idx_attachments_thread_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "fk_attachments_message_id": { - "name": "fk_attachments_message_id", - "tableFrom": "attachments", - "tableTo": "messages", - "columnsFrom": [ - "message_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.messages": { - "name": "messages", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "edited_content": { - "name": "edited_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "edited_at": { - "name": "edited_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_status": { - "name": "ai_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "ai_moderation_flags": { - "name": "ai_moderation_flags", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_moderation_score": { - "name": "ai_moderation_score", - "type": "real", - "primaryKey": false, - "notNull": false - }, - "ai_moderation_raw": { - "name": "ai_moderation_raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_analysis": { - "name": "ai_analysis", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_analyzed_at": { - "name": "ai_analyzed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "ai_error": { - "name": "ai_error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_messages_channel": { - "name": "idx_messages_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_user": { - "name": "idx_messages_user", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_created": { - "name": "idx_messages_created", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread": { - "name": "idx_messages_thread", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_channel_created": { - "name": "idx_messages_channel_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread_created": { - "name": "idx_messages_thread_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_ai_status_created": { - "name": "idx_messages_ai_status_created", - "columns": [ - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_guild_ai_status_created": { - "name": "idx_messages_guild_ai_status_created", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.muxer_jobs": { - "name": "muxer_jobs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "data": { - "name": "data", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "maxAttempts": { - "name": "maxAttempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 3 - }, - "createdAt": { - "name": "createdAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "updatedAt": { - "name": "updatedAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_muxer_jobs_status": { - "name": "idx_muxer_jobs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_muxer_jobs_createdAt": { - "name": "idx_muxer_jobs_createdAt", - "columns": [ - { - "expression": "createdAt", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ui_state": { - "name": "ui_state", - "schema": "", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/migrations/meta/0002_snapshot.json b/drizzle/migrations/meta/0002_snapshot.json deleted file mode 100644 index 350a617..0000000 --- a/drizzle/migrations/meta/0002_snapshot.json +++ /dev/null @@ -1,943 +0,0 @@ -{ - "id": "a4dd8687-4a2c-4520-9cc5-03aa1774e383", - "prevId": "79348c3a-b314-4bfd-88f3-7ddfbea4427e", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ai_analysis_runs": { - "name": "ai_analysis_runs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "conversation_key": { - "name": "conversation_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "target_message_ids": { - "name": "target_message_ids", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "request_tokens_estimate": { - "name": "request_tokens_estimate", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "response_raw": { - "name": "response_raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "completed_at": { - "name": "completed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_ai_analysis_runs_conversation_key": { - "name": "idx_ai_analysis_runs_conversation_key", - "columns": [ - { - "expression": "conversation_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_ai_analysis_runs_status": { - "name": "idx_ai_analysis_runs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_ai_analysis_runs_created_at": { - "name": "idx_ai_analysis_runs_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.attachments": { - "name": "attachments", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filename": { - "name": "filename", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size": { - "name": "size", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "discord_url": { - "name": "discord_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "uploaded_url": { - "name": "uploaded_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "upload_status": { - "name": "upload_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "upload_error": { - "name": "upload_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "uploaded_at": { - "name": "uploaded_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_attachments_channel": { - "name": "idx_attachments_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_message": { - "name": "idx_attachments_message", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_status": { - "name": "idx_attachments_status", - "columns": [ - { - "expression": "upload_status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_channel_created": { - "name": "idx_attachments_channel_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_thread_created": { - "name": "idx_attachments_thread_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "fk_attachments_message_id": { - "name": "fk_attachments_message_id", - "tableFrom": "attachments", - "tableTo": "messages", - "columnsFrom": [ - "message_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.messages": { - "name": "messages", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "edited_content": { - "name": "edited_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "edited_at": { - "name": "edited_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_status": { - "name": "ai_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "ai_moderation_flags": { - "name": "ai_moderation_flags", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_moderation_score": { - "name": "ai_moderation_score", - "type": "real", - "primaryKey": false, - "notNull": false - }, - "ai_moderation_raw": { - "name": "ai_moderation_raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_analysis": { - "name": "ai_analysis", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_analyzed_at": { - "name": "ai_analyzed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "ai_error": { - "name": "ai_error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_messages_channel": { - "name": "idx_messages_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_user": { - "name": "idx_messages_user", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_created": { - "name": "idx_messages_created", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread": { - "name": "idx_messages_thread", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_channel_created": { - "name": "idx_messages_channel_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread_created": { - "name": "idx_messages_thread_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_ai_status_created": { - "name": "idx_messages_ai_status_created", - "columns": [ - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_guild_ai_status_created": { - "name": "idx_messages_guild_ai_status_created", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.muxer_jobs": { - "name": "muxer_jobs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "data": { - "name": "data", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "maxAttempts": { - "name": "maxAttempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 3 - }, - "createdAt": { - "name": "createdAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "updatedAt": { - "name": "updatedAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_muxer_jobs_status": { - "name": "idx_muxer_jobs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_muxer_jobs_createdAt": { - "name": "idx_muxer_jobs_createdAt", - "columns": [ - { - "expression": "createdAt", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ui_state": { - "name": "ui_state", - "schema": "", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.voice_recordings": { - "name": "voice_recordings", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "channel_name": { - "name": "channel_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "filename": { - "name": "filename", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size_bytes": { - "name": "size_bytes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "download_url": { - "name": "download_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "upload_status": { - "name": "upload_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "upload_error": { - "name": "upload_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "uploaded_at": { - "name": "uploaded_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_voice_recordings_user_id": { - "name": "idx_voice_recordings_user_id", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_voice_recordings_channel_id": { - "name": "idx_voice_recordings_channel_id", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_voice_recordings_created_at": { - "name": "idx_voice_recordings_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/migrations/meta/0005_snapshot.json b/drizzle/migrations/meta/0005_snapshot.json deleted file mode 100644 index f2cb42f..0000000 --- a/drizzle/migrations/meta/0005_snapshot.json +++ /dev/null @@ -1,1456 +0,0 @@ -{ - "id": "5f2738a8-e164-4648-91a3-393be1e1b69d", - "prevId": "a4dd8687-4a2c-4520-9cc5-03aa1774e383", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ai_analysis_runs": { - "name": "ai_analysis_runs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "conversation_key": { - "name": "conversation_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "target_message_ids": { - "name": "target_message_ids", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "request_tokens_estimate": { - "name": "request_tokens_estimate", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "response_raw": { - "name": "response_raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "completed_at": { - "name": "completed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_ai_analysis_runs_conversation_key": { - "name": "idx_ai_analysis_runs_conversation_key", - "columns": [ - { - "expression": "conversation_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_ai_analysis_runs_status": { - "name": "idx_ai_analysis_runs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_ai_analysis_runs_created_at": { - "name": "idx_ai_analysis_runs_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.attachments": { - "name": "attachments", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filename": { - "name": "filename", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size": { - "name": "size", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "discord_url": { - "name": "discord_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "uploaded_url": { - "name": "uploaded_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "upload_status": { - "name": "upload_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "upload_error": { - "name": "upload_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "uploaded_at": { - "name": "uploaded_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_attachments_channel": { - "name": "idx_attachments_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_message": { - "name": "idx_attachments_message", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_status": { - "name": "idx_attachments_status", - "columns": [ - { - "expression": "upload_status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_channel_created": { - "name": "idx_attachments_channel_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_thread_created": { - "name": "idx_attachments_thread_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "fk_attachments_message_id": { - "name": "fk_attachments_message_id", - "tableFrom": "attachments", - "tableTo": "messages", - "columnsFrom": [ - "message_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.message_reviews": { - "name": "message_reviews", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reviewer_id": { - "name": "reviewer_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "notes": { - "name": "notes", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "reviewed_at": { - "name": "reviewed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_message_reviews_message_id": { - "name": "idx_message_reviews_message_id", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_message_reviews_status": { - "name": "idx_message_reviews_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_message_reviews_created_at": { - "name": "idx_message_reviews_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_message_reviews_guild_status": { - "name": "idx_message_reviews_guild_status", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.messages": { - "name": "messages", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "edited_content": { - "name": "edited_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "edited_at": { - "name": "edited_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_status": { - "name": "ai_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "ai_moderation_flags": { - "name": "ai_moderation_flags", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_moderation_score": { - "name": "ai_moderation_score", - "type": "real", - "primaryKey": false, - "notNull": false - }, - "ai_analysis": { - "name": "ai_analysis", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_categories": { - "name": "ai_categories", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_severity": { - "name": "ai_severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_confidence": { - "name": "ai_confidence", - "type": "real", - "primaryKey": false, - "notNull": false - }, - "ai_recommended_action": { - "name": "ai_recommended_action", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_analyzed_at": { - "name": "ai_analyzed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "ai_error": { - "name": "ai_error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_messages_channel": { - "name": "idx_messages_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_user": { - "name": "idx_messages_user", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_created": { - "name": "idx_messages_created", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread": { - "name": "idx_messages_thread", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_channel_created": { - "name": "idx_messages_channel_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread_created": { - "name": "idx_messages_thread_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_ai_status_created": { - "name": "idx_messages_ai_status_created", - "columns": [ - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_guild_ai_status_created": { - "name": "idx_messages_guild_ai_status_created", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_guild_created_deleted": { - "name": "idx_messages_guild_created_deleted", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_channel_ai_status_created": { - "name": "idx_messages_channel_ai_status_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread_ai_status_created": { - "name": "idx_messages_thread_ai_status_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.moderation_actions": { - "name": "moderation_actions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "action_type": { - "name": "action_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "executed_by": { - "name": "executed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "executed_at": { - "name": "executed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_moderation_actions_message_id": { - "name": "idx_moderation_actions_message_id", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_moderation_actions_user_id": { - "name": "idx_moderation_actions_user_id", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_moderation_actions_status": { - "name": "idx_moderation_actions_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_moderation_actions_guild_status": { - "name": "idx_moderation_actions_guild_status", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.muxer_jobs": { - "name": "muxer_jobs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "data": { - "name": "data", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "maxAttempts": { - "name": "maxAttempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 3 - }, - "createdAt": { - "name": "createdAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "updatedAt": { - "name": "updatedAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_muxer_jobs_status": { - "name": "idx_muxer_jobs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_muxer_jobs_createdAt": { - "name": "idx_muxer_jobs_createdAt", - "columns": [ - { - "expression": "createdAt", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.retention_policies": { - "name": "retention_policies", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 90 - }, - "apply_to_media": { - "name": "apply_to_media", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "apply_to_voice": { - "name": "apply_to_voice", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_retention_policies_guild_id": { - "name": "idx_retention_policies_guild_id", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_retention_policies_enabled": { - "name": "idx_retention_policies_enabled", - "columns": [ - { - "expression": "enabled", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ui_state": { - "name": "ui_state", - "schema": "", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.voice_recordings": { - "name": "voice_recordings", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "channel_name": { - "name": "channel_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "filename": { - "name": "filename", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size_bytes": { - "name": "size_bytes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "download_url": { - "name": "download_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "upload_status": { - "name": "upload_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "upload_error": { - "name": "upload_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "uploaded_at": { - "name": "uploaded_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_voice_recordings_user_id": { - "name": "idx_voice_recordings_user_id", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_voice_recordings_channel_id": { - "name": "idx_voice_recordings_channel_id", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_voice_recordings_created_at": { - "name": "idx_voice_recordings_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/migrations/meta/0007_snapshot.json b/drizzle/migrations/meta/0007_snapshot.json deleted file mode 100644 index 3b5659a..0000000 --- a/drizzle/migrations/meta/0007_snapshot.json +++ /dev/null @@ -1,1598 +0,0 @@ -{ - "id": "ca999270-5f44-4009-a8c9-0fd463f911a0", - "prevId": "5f2738a8-e164-4648-91a3-393be1e1b69d", - "version": "7", - "dialect": "postgresql", - "tables": { - "public.ai_analysis_runs": { - "name": "ai_analysis_runs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "conversation_key": { - "name": "conversation_key", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "target_message_ids": { - "name": "target_message_ids", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "model": { - "name": "model", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "request_tokens_estimate": { - "name": "request_tokens_estimate", - "type": "integer", - "primaryKey": false, - "notNull": false - }, - "response_raw": { - "name": "response_raw", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "completed_at": { - "name": "completed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_ai_analysis_runs_conversation_key": { - "name": "idx_ai_analysis_runs_conversation_key", - "columns": [ - { - "expression": "conversation_key", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_ai_analysis_runs_status": { - "name": "idx_ai_analysis_runs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_ai_analysis_runs_created_at": { - "name": "idx_ai_analysis_runs_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.attachments": { - "name": "attachments", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "filename": { - "name": "filename", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size": { - "name": "size", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "discord_url": { - "name": "discord_url", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "uploaded_url": { - "name": "uploaded_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "upload_status": { - "name": "upload_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "upload_error": { - "name": "upload_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "uploaded_at": { - "name": "uploaded_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_attachments_channel": { - "name": "idx_attachments_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_message": { - "name": "idx_attachments_message", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_status": { - "name": "idx_attachments_status", - "columns": [ - { - "expression": "upload_status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_channel_created": { - "name": "idx_attachments_channel_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_attachments_thread_created": { - "name": "idx_attachments_thread_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": { - "fk_attachments_message_id": { - "name": "fk_attachments_message_id", - "tableFrom": "attachments", - "tableTo": "messages", - "columnsFrom": [ - "message_id" - ], - "columnsTo": [ - "id" - ], - "onDelete": "cascade", - "onUpdate": "no action" - } - }, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.message_reviews": { - "name": "message_reviews", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reviewer_id": { - "name": "reviewer_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "notes": { - "name": "notes", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "reviewed_at": { - "name": "reviewed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_message_reviews_message_id": { - "name": "idx_message_reviews_message_id", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_message_reviews_status": { - "name": "idx_message_reviews_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_message_reviews_created_at": { - "name": "idx_message_reviews_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_message_reviews_guild_status": { - "name": "idx_message_reviews_guild_status", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.messages": { - "name": "messages", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "thread_id": { - "name": "thread_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "content": { - "name": "content", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "edited_content": { - "name": "edited_content", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "edited_at": { - "name": "edited_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "deleted_at": { - "name": "deleted_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "type": { - "name": "type", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'text'" - }, - "metadata": { - "name": "metadata", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_status": { - "name": "ai_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "ai_moderation_flags": { - "name": "ai_moderation_flags", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_moderation_score": { - "name": "ai_moderation_score", - "type": "real", - "primaryKey": false, - "notNull": false - }, - "ai_analysis": { - "name": "ai_analysis", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_categories": { - "name": "ai_categories", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_severity": { - "name": "ai_severity", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_confidence": { - "name": "ai_confidence", - "type": "real", - "primaryKey": false, - "notNull": false - }, - "ai_recommended_action": { - "name": "ai_recommended_action", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "ai_analyzed_at": { - "name": "ai_analyzed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - }, - "ai_error": { - "name": "ai_error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_messages_channel": { - "name": "idx_messages_channel", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_user": { - "name": "idx_messages_user", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_created": { - "name": "idx_messages_created", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread": { - "name": "idx_messages_thread", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_channel_created": { - "name": "idx_messages_channel_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread_created": { - "name": "idx_messages_thread_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_ai_status_created": { - "name": "idx_messages_ai_status_created", - "columns": [ - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_guild_ai_status_created": { - "name": "idx_messages_guild_ai_status_created", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_guild_created_deleted": { - "name": "idx_messages_guild_created_deleted", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "deleted_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_channel_ai_status_created": { - "name": "idx_messages_channel_ai_status_created", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_messages_thread_ai_status_created": { - "name": "idx_messages_thread_ai_status_created", - "columns": [ - { - "expression": "thread_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "ai_status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.moderation_actions": { - "name": "moderation_actions", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "message_id": { - "name": "message_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "action_type": { - "name": "action_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "reason": { - "name": "reason", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "executed_by": { - "name": "executed_by", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "executed_at": { - "name": "executed_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_moderation_actions_message_id": { - "name": "idx_moderation_actions_message_id", - "columns": [ - { - "expression": "message_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_moderation_actions_user_id": { - "name": "idx_moderation_actions_user_id", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_moderation_actions_status": { - "name": "idx_moderation_actions_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_moderation_actions_guild_status": { - "name": "idx_moderation_actions_guild_status", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - }, - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.muxer_jobs": { - "name": "muxer_jobs", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "data": { - "name": "data", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "status": { - "name": "status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "attempts": { - "name": "attempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - }, - "maxAttempts": { - "name": "maxAttempts", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 3 - }, - "createdAt": { - "name": "createdAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "updatedAt": { - "name": "updatedAt", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "error": { - "name": "error", - "type": "text", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_muxer_jobs_status": { - "name": "idx_muxer_jobs_status", - "columns": [ - { - "expression": "status", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_muxer_jobs_createdAt": { - "name": "idx_muxer_jobs_createdAt", - "columns": [ - { - "expression": "createdAt", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.retention_policies": { - "name": "retention_policies", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "retention_days": { - "name": "retention_days", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 90 - }, - "apply_to_media": { - "name": "apply_to_media", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "apply_to_voice": { - "name": "apply_to_voice", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "enabled": { - "name": "enabled", - "type": "boolean", - "primaryKey": false, - "notNull": true, - "default": true - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_retention_policies_guild_id": { - "name": "idx_retention_policies_guild_id", - "columns": [ - { - "expression": "guild_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_retention_policies_enabled": { - "name": "idx_retention_policies_enabled", - "columns": [ - { - "expression": "enabled", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.sticker_cache": { - "name": "sticker_cache", - "schema": "", - "columns": { - "name": { - "name": "name", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "base64": { - "name": "base64", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "mime_type": { - "name": "mime_type", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size": { - "name": "size", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "fetched_at": { - "name": "fetched_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": { - "idx_sticker_cache_fetched_at": { - "name": "idx_sticker_cache_fetched_at", - "columns": [ - { - "expression": "fetched_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.text_analysis_cache": { - "name": "text_analysis_cache", - "schema": "", - "columns": { - "text": { - "name": "text", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "flags": { - "name": "flags", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'[]'" - }, - "source": { - "name": "source", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'local'" - }, - "analyzed_at": { - "name": "analyzed_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "expires_at": { - "name": "expires_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "hit_count": { - "name": "hit_count", - "type": "integer", - "primaryKey": false, - "notNull": true, - "default": 0 - } - }, - "indexes": { - "idx_text_analysis_cache_expires_at": { - "name": "idx_text_analysis_cache_expires_at", - "columns": [ - { - "expression": "expires_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_text_analysis_cache_source": { - "name": "idx_text_analysis_cache_source", - "columns": [ - { - "expression": "source", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.ui_state": { - "name": "ui_state", - "schema": "", - "columns": { - "key": { - "name": "key", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "value": { - "name": "value", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "updated_at": { - "name": "updated_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - } - }, - "indexes": {}, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - }, - "public.voice_recordings": { - "name": "voice_recordings", - "schema": "", - "columns": { - "id": { - "name": "id", - "type": "text", - "primaryKey": true, - "notNull": true - }, - "user_id": { - "name": "user_id", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "username": { - "name": "username", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "avatar_url": { - "name": "avatar_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "guild_id": { - "name": "guild_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "channel_id": { - "name": "channel_id", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "channel_name": { - "name": "channel_name", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "filename": { - "name": "filename", - "type": "text", - "primaryKey": false, - "notNull": true - }, - "size_bytes": { - "name": "size_bytes", - "type": "integer", - "primaryKey": false, - "notNull": true - }, - "download_url": { - "name": "download_url", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "upload_status": { - "name": "upload_status", - "type": "text", - "primaryKey": false, - "notNull": true, - "default": "'pending'" - }, - "upload_error": { - "name": "upload_error", - "type": "text", - "primaryKey": false, - "notNull": false - }, - "created_at": { - "name": "created_at", - "type": "bigint", - "primaryKey": false, - "notNull": true - }, - "uploaded_at": { - "name": "uploaded_at", - "type": "bigint", - "primaryKey": false, - "notNull": false - } - }, - "indexes": { - "idx_voice_recordings_user_id": { - "name": "idx_voice_recordings_user_id", - "columns": [ - { - "expression": "user_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_voice_recordings_channel_id": { - "name": "idx_voice_recordings_channel_id", - "columns": [ - { - "expression": "channel_id", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - }, - "idx_voice_recordings_created_at": { - "name": "idx_voice_recordings_created_at", - "columns": [ - { - "expression": "created_at", - "isExpression": false, - "asc": true, - "nulls": "last" - } - ], - "isUnique": false, - "concurrently": false, - "method": "btree", - "with": {} - } - }, - "foreignKeys": {}, - "compositePrimaryKeys": {}, - "uniqueConstraints": {}, - "policies": {}, - "checkConstraints": {}, - "isRLSEnabled": false - } - }, - "enums": {}, - "schemas": {}, - "sequences": {}, - "roles": {}, - "policies": {}, - "views": {}, - "_meta": { - "columns": {}, - "schemas": {}, - "tables": {} - } -} \ No newline at end of file diff --git a/drizzle/migrations/meta/_journal.json b/drizzle/migrations/meta/_journal.json deleted file mode 100644 index 0f17292..0000000 --- a/drizzle/migrations/meta/_journal.json +++ /dev/null @@ -1,55 +0,0 @@ -{ - "version": "7", - "dialect": "postgresql", - "entries": [ - { - "idx": 0, - "version": "7", - "when": 1778750697764, - "tag": "0000_rare_kitty_pryde", - "breakpoints": true - }, - { - "idx": 1, - "version": "7", - "when": 1778764447718, - "tag": "0001_curious_zodiak", - "breakpoints": true - }, - { - "idx": 2, - "version": "7", - "when": 1779109619461, - "tag": "0002_dark_omega_flight", - "breakpoints": true - }, - { - "idx": 3, - "version": "7", - "when": 1780079000000, - "tag": "0003_ai_moderation_review_guardrails", - "breakpoints": true - }, - { - "idx": 5, - "version": "7", - "when": 1780218363790, - "tag": "0005_optimize-message-index", - "breakpoints": true - }, - { - "idx": 6, - "version": "7", - "when": 1780218363791, - "tag": "0006_fix_text_analysis_cache_source", - "breakpoints": true - }, - { - "idx": 7, - "version": "7", - "when": 1780396315249, - "tag": "0007_black_nova", - "breakpoints": true - } - ] -} \ No newline at end of file diff --git a/packages/shared/.moon.yml b/packages/shared/.moon.yml new file mode 100644 index 0000000..46eca25 --- /dev/null +++ b/packages/shared/.moon.yml @@ -0,0 +1,11 @@ +$schema: 'https://moonrepo.dev/schema/config/v2.json' + +language: typescript +type: library + +tasks: + typecheck: + command: tsc --noEmit + inputs: + - src + - tsconfig.json diff --git a/services/backend/.moon.yml b/services/backend/.moon.yml new file mode 100644 index 0000000..db03877 --- /dev/null +++ b/services/backend/.moon.yml @@ -0,0 +1,39 @@ +# Backend service - Discord moderation monitoring +language: typescript +type: application + +tasks: + dev: + command: tsx watch src/index.ts + local: true + + build: + command: tsc + inputs: + - src + - tsconfig.json + outputs: + - dist + + typecheck: + command: tsc --noEmit + inputs: + - src + - tsconfig.json + + lint: + command: biome check --diagnostic-level=error . + inputs: + - src + + format: + command: biome format --write . + inputs: + - src + + test: + command: vitest run + inputs: + - src + - tests + - tsconfig.json diff --git a/services/discord-gateway/.moon.yml b/services/discord-gateway/.moon.yml new file mode 100644 index 0000000..190f8b9 --- /dev/null +++ b/services/discord-gateway/.moon.yml @@ -0,0 +1,39 @@ +# Discord Gateway service - handles message capture, voice recording, and AI moderation +language: typescript +type: application + +tasks: + dev: + command: tsx watch src/index.ts + local: true + + build: + command: tsc + inputs: + - src + - tsconfig.json + outputs: + - dist + + typecheck: + command: tsc --noEmit + inputs: + - src + - tsconfig.json + + lint: + command: biome check --diagnostic-level=error . + inputs: + - src + + format: + command: biome format --write . + inputs: + - src + + test: + command: vitest run + inputs: + - src + - tests + - tsconfig.json diff --git a/services/frontend/.moon.yml b/services/frontend/.moon.yml new file mode 100644 index 0000000..be9a9ec --- /dev/null +++ b/services/frontend/.moon.yml @@ -0,0 +1,38 @@ +# Frontend web application +language: typescript +type: application + +tasks: + dev: + command: vite --host 0.0.0.0 + local: true + + build: + command: tsc --noEmit && NODE_NO_WARNINGS=1 vite build + inputs: + - src + - tsconfig.json + - vite.config.mts + - index.html + outputs: + - dist + + preview: + command: vite preview --host 0.0.0.0 --port 3000 + local: true + + typecheck: + command: tsc --noEmit + inputs: + - src + - tsconfig.json + + lint: + command: biome check --diagnostic-level=error src/ + inputs: + - src + + format: + command: biome format --write src/ + inputs: + - src