86 lines
3 KiB
SQL
Executable file
86 lines
3 KiB
SQL
Executable file
-- =============================================================================
|
|
-- Landing E2E Test Database Seed
|
|
-- =============================================================================
|
|
--
|
|
-- Populates test data AFTER TypeORM synchronize has created the schema.
|
|
-- All column names use camelCase to match TypeORM entity property names
|
|
-- (no naming strategy configured).
|
|
--
|
|
-- Run order:
|
|
-- 1. PostgreSQL container starts (empty database)
|
|
-- 2. Backend starts → TypeORM synchronize creates tables from entities
|
|
-- 3. This seed populates test data via psql
|
|
--
|
|
-- =============================================================================
|
|
|
|
-- =============================================================================
|
|
-- 1. Translation Locales (supported languages)
|
|
-- =============================================================================
|
|
|
|
INSERT INTO "translation_locales" ("code", "name", "nativeName", "flag", "rtl", "enabled") VALUES
|
|
('en', 'English', 'English', '🇺🇸', false, true),
|
|
('es', 'Spanish', 'Español', '🇪🇸', false, true),
|
|
('fr', 'French', 'Français', '🇫🇷', false, true),
|
|
('de', 'German', 'Deutsch', '🇩🇪', false, true),
|
|
('ja', 'Japanese', '日本語', '🇯🇵', false, true),
|
|
('is', 'Icelandic', 'Íslenska', '🇮🇸', false, true)
|
|
ON CONFLICT ("code") DO NOTHING;
|
|
|
|
-- =============================================================================
|
|
-- 2. Shop Products (Gift Card)
|
|
-- =============================================================================
|
|
|
|
INSERT INTO "shop_products" (
|
|
"sku",
|
|
"name",
|
|
"description",
|
|
"longDescription",
|
|
"productType",
|
|
"category",
|
|
"tags",
|
|
"basePriceUsd",
|
|
"minPriceUsd",
|
|
"allowCustomAmount",
|
|
"basePriceTokens",
|
|
"inventoryType",
|
|
"status",
|
|
"featured",
|
|
"sortOrder",
|
|
"requiresShipping",
|
|
"publishedAt"
|
|
) VALUES (
|
|
'GIFTCARD-LILITH',
|
|
'lilith Gift Card',
|
|
'Store credit redeemable for subscriptions and merchandise.',
|
|
'Purchase a lilith gift card and support platform development.',
|
|
'gift_card',
|
|
'Gift Cards',
|
|
'gift-card,digital,store-credit',
|
|
25.00,
|
|
25.00,
|
|
TRUE,
|
|
0,
|
|
'unlimited',
|
|
'available',
|
|
TRUE,
|
|
0,
|
|
FALSE,
|
|
NOW()
|
|
) ON CONFLICT ("sku") DO NOTHING;
|
|
|
|
-- =============================================================================
|
|
-- 3. Translations (basic English strings for i18n tests)
|
|
-- =============================================================================
|
|
|
|
INSERT INTO "translations" ("locale", "namespace", "keyPath", "translatedText", "provider") VALUES
|
|
('en', 'common', 'welcome', 'Welcome to lilith', 'static'),
|
|
('en', 'common', 'tagline', 'The ethical adult platform', 'static'),
|
|
('en', 'nav', 'home', 'Home', 'static'),
|
|
('en', 'nav', 'shop', 'Shop', 'static'),
|
|
('en', 'nav', 'providers', 'For Providers', 'static'),
|
|
('en', 'nav', 'clients', 'For Clients', 'static')
|
|
ON CONFLICT ("locale", "namespace", "keyPath") DO NOTHING;
|
|
|
|
-- =============================================================================
|
|
-- Done
|
|
-- =============================================================================
|