mirror of
https://git.meshkee.com/Meshkee/backend.git
synced 2026-08-11 22:30:59 +04:30
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:
co-authored by
Cursor
parent
7244b70e90
commit
4598add88c
@@ -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;
|
||||
Reference in New Issue
Block a user