Files
flatrender/services/content/migrations/002_seed_blog_learn_pages.sql
soroush.asadi 1f6c35eb7c
Build backend images / build content-svc (push) Failing after 1m16s
Build backend images / build file-svc (push) Failing after 53s
Build backend images / build gateway (push) Failing after 53s
Build backend images / build identity-svc (push) Failing after 1m7s
Build backend images / build notification-svc (push) Failing after 59s
Build backend images / build render-svc (push) Failing after 47s
Build backend images / build studio-svc (push) Failing after 1m2s
chore(content): seed demo blog + learn posts and CMS page rows
Idempotent seed (services/content/migrations/002_seed_blog_learn_pages.sql):
one Blog article, one Learn tutorial, and the 7 static Page rows
(about/contact/careers/privacy/terms/cookies/help) so the new public sections
render with real content and the admin "Pages" section has editable rows.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
2026-06-11 23:13:48 +03:30

38 lines
5.0 KiB
SQL
Raw Permalink Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
-- Demo content so the new public sections render with real data and the admin
-- "Pages" section has editable rows. Idempotent: each row inserts only when a
-- live (non-deleted) row with that slug does not already exist.
--
-- Requires 001_blog_kind_learn_page.sql first (the Learn/Page enum values).
-- ── A demo blog article ───────────────────────────────────────────────────────
INSERT INTO content.blogs (id, kind, slug, title, short_description, content, is_published, include_in_site_map, view_count, created_at, updated_at)
SELECT gen_random_uuid(), 'Blog'::content.blog_kind, 'getting-started-with-flatrender',
'شروع کار با فلت‌رندر',
'در چند دقیقه اولین ویدیوی حرفه‌ای خود را بسازید.',
'<h2>به فلت‌رندر خوش آمدید</h2><p>با فلت‌رندر می‌توانید بدون نیاز به دانش تخصصی، ویدیو و تصویر حرفه‌ای بسازید. کافی است یک قالب را انتخاب کنید، متن‌ها و رنگ‌ها را تغییر دهید و خروجی بگیرید.</p><h3>گام‌های ساده</h3><ul><li>یک قالب از گالری انتخاب کنید</li><li>محتوای خود را وارد کنید</li><li>خروجی ویدیو را دانلود کنید</li></ul>',
true, true, 0, now(), now()
WHERE NOT EXISTS (SELECT 1 FROM content.blogs WHERE slug = 'getting-started-with-flatrender' AND deleted_at IS NULL);
-- ── A demo learn (tutorial) article ───────────────────────────────────────────
INSERT INTO content.blogs (id, kind, slug, title, short_description, content, is_published, include_in_site_map, view_count, created_at, updated_at)
SELECT gen_random_uuid(), 'Learn'::content.blog_kind, 'how-to-edit-a-template',
'چگونه یک قالب را ویرایش کنیم',
'آموزش گام‌به‌گام ویرایش متن، تصویر و رنگ در استودیو.',
'<h2>ویرایش قالب در استودیو</h2><p>پس از انتخاب قالب، وارد استودیو می‌شوید. در این آموزش یاد می‌گیرید چطور هر بخش را شخصی‌سازی کنید.</p><h3>۱. تغییر متن</h3><p>روی هر متن کلیک کنید و محتوای دلخواه را تایپ کنید.</p><h3>۲. جایگزینی تصویر</h3><p>تصاویر خود را بارگذاری کرده و جایگزین نمونه‌ها کنید.</p><h3>۳. تنظیم رنگ‌ها</h3><p>از پنل رنگ، پالت رنگی ویدیو را مطابق برند خود تغییر دهید.</p>',
true, true, 0, now(), now()
WHERE NOT EXISTS (SELECT 1 FROM content.blogs WHERE slug = 'how-to-edit-a-template' AND deleted_at IS NULL);
-- ── Static CMS pages (kind = Page) ────────────────────────────────────────────
INSERT INTO content.blogs (id, kind, slug, title, content, is_published, include_in_site_map, view_count, created_at, updated_at)
SELECT gen_random_uuid(), 'Page'::content.blog_kind, v.slug, v.title, v.content, true, true, 0, now(), now()
FROM (VALUES
('about', 'دربارهٔ ما', '<p>فلت‌رندر پلتفرمی برای ساخت ویدیو و تصویر حرفه‌ای با کمک قالب‌های آماده و ابزارهای هوشمند است. مأموریت ما ساده‌سازی تولید محتوای حرفه‌ای برای همه است.</p>'),
('contact', 'تماس با ما', '<p>برای پشتیبانی یا همکاری با ما در تماس باشید:</p><p>ایمیل: support@flatrender.com</p>'),
('careers', 'فرصت‌های شغلی', '<p>ما همیشه به دنبال افراد بااستعداد هستیم. رزومهٔ خود را به jobs@flatrender.com ارسال کنید.</p>'),
('privacy', 'حریم خصوصی', '<p>حفظ حریم خصوصی شما برای ما اهمیت دارد. این صفحه نحوهٔ گردآوری و استفاده از اطلاعات شما را توضیح می‌دهد. (متن نمونه — توسط مدیر تکمیل شود.)</p>'),
('terms', 'شرایط استفاده', '<p>با استفاده از فلت‌رندر، شرایط خدمات ما را می‌پذیرید. (متن نمونه — توسط مدیر تکمیل شود.)</p>'),
('cookies', 'سیاست کوکی', '<p>ما از کوکی‌ها برای بهبود تجربهٔ شما استفاده می‌کنیم. (متن نمونه — توسط مدیر تکمیل شود.)</p>'),
('help', 'مرکز راهنما', '<p>به مرکز راهنمای فلت‌رندر خوش آمدید. برای آموزش‌های بیشتر بخش «آموزش» را ببینید.</p>')
) AS v(slug, title, content)
WHERE NOT EXISTS (SELECT 1 FROM content.blogs b WHERE b.slug = v.slug AND b.deleted_at IS NULL);