chore: hapus fitur materi (learning materials + RAG chat)
Hapus fitur materi seluruhnya dari GMW monorepo: Backend: - Hapus module materi/ (index.ts, materi.repository.ts, materi.schema.ts, materi.service.ts, ragClient.ts) - Hapus materiRouter dari orpc/router.ts (imports, const, appRouter entry) - Hapus pgMateriDocumentsTable + types dari shared/database/schema.ts Frontend: - Hapus route pages app/(dashboard)/materi/ (page, [id], chat, new) - Hapus lib/api/materi.ts (oRPC client wrappers) - Hapus lib/types/materi.ts + export dari index.ts - Hapus nav item "Materi" dari lib/navigation.ts + unused BookOpen import Scripts: - Hapus scripts/add-materi-documents.sql - Tambah scripts/drop-materi-documents.sql (ops DB cleanup) Verification: - Backend: npx tsc --noEmit — clean (exit 0) - Frontend: npx tsc --noEmit — clean (exit 0) - Grep: zero materi code references remaining (hanya di drop-materi-documents.sql) RAG dependencies (messages/embed.ts, messages/qdrant.ts) tetap karena juga dipakai oleh messages.service.ts.
This commit is contained in:
@@ -1,29 +0,0 @@
|
||||
-- Migration: Add materi_documents table for learning materials + RAG
|
||||
-- Run: PGPASSWORD=<pw> psql -h <host> -U <user> -d <db> -f scripts/add-materi-documents.sql
|
||||
-- Schema mirrors services/backend/src/shared/database/schema.ts (pgMateriDocumentsTable).
|
||||
|
||||
BEGIN;
|
||||
|
||||
CREATE TABLE IF NOT EXISTS public.materi_documents (
|
||||
id uuid PRIMARY KEY DEFAULT gen_random_uuid(),
|
||||
title text NOT NULL,
|
||||
description text,
|
||||
content text NOT NULL,
|
||||
category text NOT NULL DEFAULT 'general',
|
||||
tags jsonb NOT NULL DEFAULT '[]',
|
||||
owner_user_id text NOT NULL DEFAULT 'anonymous',
|
||||
guild_id text,
|
||||
channel_id text,
|
||||
is_public boolean NOT NULL DEFAULT true,
|
||||
view_count integer NOT NULL DEFAULT 0,
|
||||
created_at bigint NOT NULL DEFAULT (EXTRACT(epoch FROM now())::bigint * 1000),
|
||||
updated_at bigint NOT NULL DEFAULT (EXTRACT(epoch FROM now())::bigint * 1000)
|
||||
);
|
||||
|
||||
-- Indexes mirror the Drizzle index definitions (idx_materi_category, idx_materi_owner, idx_materi_guild, idx_materi_search).
|
||||
CREATE INDEX IF NOT EXISTS idx_materi_category ON public.materi_documents (category);
|
||||
CREATE INDEX IF NOT EXISTS idx_materi_owner ON public.materi_documents (owner_user_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_materi_guild ON public.materi_documents (guild_id);
|
||||
CREATE INDEX IF NOT EXISTS idx_materi_search ON public.materi_documents (title, category);
|
||||
|
||||
COMMIT;
|
||||
@@ -0,0 +1,14 @@
|
||||
-- Migration: Drop materi_documents table (feature removed)
|
||||
-- Run: PGPASSWORD=<pw> psql -h <host> -U <user> -d <db> -f scripts/drop-materi-documents.sql
|
||||
-- Reverses scripts/add-materi-documents.sql which was deleted with the feature.
|
||||
|
||||
BEGIN;
|
||||
|
||||
DROP INDEX IF EXISTS idx_materi_search;
|
||||
DROP INDEX IF EXISTS idx_materi_guild;
|
||||
DROP INDEX IF EXISTS idx_materi_owner;
|
||||
DROP INDEX IF EXISTS idx_materi_category;
|
||||
|
||||
DROP TABLE IF EXISTS public.materi_documents;
|
||||
|
||||
COMMIT;
|
||||
Reference in New Issue
Block a user