managarten/maerchenzauber/apps/backend/make-character-public.sql
Till-JS e7f5f942f3 chore: initial commit - consolidate 4 projects into monorepo
Projects included:
- maerchenzauber (NestJS backend + Expo mobile + SvelteKit web + Astro landing)
- manacore (Expo mobile + SvelteKit web + Astro landing)
- manadeck (NestJS backend + Expo mobile + SvelteKit web)
- memoro (Expo mobile + SvelteKit web + Astro landing)

This commit preserves the current state before monorepo restructuring.

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude <noreply@anthropic.com>
2025-11-22 23:38:24 +01:00

27 lines
No EOL
562 B
SQL

-- Make the first character public for testing
-- This updates one character to be publicly visible
UPDATE characters
SET
sharing_preference = 'public',
is_published = true,
published_at = NOW(),
share_code = substring(md5(random()::text), 1, 12)
WHERE id = (
SELECT id
FROM characters
ORDER BY created_at DESC
LIMIT 1
)
RETURNING id, name, sharing_preference, is_published, share_code;
-- Verify the update
SELECT
id,
name,
sharing_preference,
is_published,
published_at,
share_code
FROM characters
WHERE is_published = true;