feat(db): add migrations for user reputation and channel culture tables

Adds new database schema migrations to support the implementation of
user reputation tracking and channel-specific culture context.

- Creates migration `0005_large_squadron_sinister.sql` containing
  `user_reputations` and `channel_cultures` tables.
- Updates Drizzle migration journal to include the new migration step.
- Adds `fix_prompt.py` utility for managing prompt adjustments.
This commit is contained in:
MythEclipse
2026-06-05 18:21:52 +07:00
parent 08c624fcf4
commit 42ea2924ac
3 changed files with 1860 additions and 0 deletions
@@ -0,0 +1,21 @@
CREATE TABLE "channel_cultures" (
"channel_id" text PRIMARY KEY NOT NULL,
"guild_id" text NOT NULL,
"culture_summary" text NOT NULL,
"last_analyzed_at" bigint NOT NULL
);
--> statement-breakpoint
CREATE TABLE "user_reputations" (
"user_id" text PRIMARY KEY NOT NULL,
"guild_id" text NOT NULL,
"trust_score" integer DEFAULT 50 NOT NULL,
"clean_message_streak" integer DEFAULT 0 NOT NULL,
"total_infractions" integer DEFAULT 0 NOT NULL,
"last_infraction_at" bigint,
"created_at" bigint NOT NULL,
"updated_at" bigint NOT NULL
);
--> statement-breakpoint
CREATE INDEX "idx_channel_cultures_guild_id" ON "channel_cultures" USING btree ("guild_id");--> statement-breakpoint
CREATE INDEX "idx_user_reputations_guild_id" ON "user_reputations" USING btree ("guild_id");--> statement-breakpoint
CREATE INDEX "idx_user_reputations_trust_score" ON "user_reputations" USING btree ("trust_score");
File diff suppressed because it is too large Load Diff
@@ -36,6 +36,13 @@
"when": 1780418800000,
"tag": "0004_drop_unused_ai_columns",
"breakpoints": true
},
{
"idx": 5,
"version": "7",
"when": 1780657801437,
"tag": "0005_large_squadron_sinister",
"breakpoints": true
}
]
}