mirror of
https://github.com/willchen96/mike.git
synced 2026-06-30 21:59:37 +02:00
refactor: add table primitive and migrations by date; feat: add mcp connectors
This commit is contained in:
parent
01dfcfe0d4
commit
9a1277ba99
99 changed files with 9344 additions and 2320 deletions
27
backend/migrations/20260602_04_drop_documents_filename.sql
Normal file
27
backend/migrations/20260602_04_drop_documents_filename.sql
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
-- Migration date: 2026-06-02
|
||||
|
||||
-- Migration: remove legacy document-level filename.
|
||||
--
|
||||
-- Before dropping the old column, copy any remaining legacy names onto
|
||||
-- version rows that do not yet have their own filename/display value.
|
||||
-- A later migration renames document_versions.display_name to filename.
|
||||
|
||||
DO $$
|
||||
BEGIN
|
||||
IF EXISTS (
|
||||
SELECT 1
|
||||
FROM information_schema.columns
|
||||
WHERE table_schema = 'public'
|
||||
AND table_name = 'documents'
|
||||
AND column_name = 'filename'
|
||||
) THEN
|
||||
UPDATE public.document_versions dv
|
||||
SET display_name = d.filename
|
||||
FROM public.documents d
|
||||
WHERE dv.document_id = d.id
|
||||
AND (dv.display_name IS NULL OR btrim(dv.display_name) = '');
|
||||
|
||||
ALTER TABLE public.documents
|
||||
DROP COLUMN filename;
|
||||
END IF;
|
||||
END $$;
|
||||
Loading…
Add table
Add a link
Reference in a new issue