Ship legacy migrate APIs, portfolio/blog old-id schema, and admin migrate/purge flows.

Co-authored-by: Cursor <cursoragent@cursor.com>
This commit is contained in:
Alireza Hassani
2026-07-29 16:10:41 +03:30
co-authored by Cursor
parent 7244b70e90
commit 4598add88c
32 changed files with 4234 additions and 265 deletions
@@ -0,0 +1,21 @@
-- Bilingual portfolio titles (legacy name / name_en)
ALTER TABLE portfolios
ADD COLUMN IF NOT EXISTS title_fa VARCHAR(255);
ALTER TABLE portfolios
ADD COLUMN IF NOT EXISTS title_en VARCHAR(255);
-- Existing rows: FA from title; EN from content.nameEn when present
UPDATE portfolios
SET title_fa = title
WHERE title_fa IS NULL;
UPDATE portfolios
SET title_en = NULLIF(BTRIM(content->>'nameEn'), '')
WHERE title_en IS NULL
AND content ? 'nameEn';
-- Keep title as the primary FA display title
UPDATE portfolios
SET title = COALESCE(NULLIF(BTRIM(title_fa), ''), title)
WHERE title_fa IS NOT NULL;