dev-template/db/seed.sql
Antoine Pelletier 572489ed5c first commit
2026-07-29 16:47:05 +02:00

13 lines
581 B
PL/PgSQL

-- Development data. Apply with:
-- psql "$DATABASE_URL" -f db/seed.sql
BEGIN;
INSERT INTO public.items (id, "name", "description") VALUES
(1, '{"fr": "Premier objet", "en": "First item"}', '{"fr": "Un objet de démonstration.", "en": "A demo item."}'),
(2, '{"fr": "Deuxième objet", "en": "Second item"}', '{"fr": "Un autre objet de démonstration.", "en": "Another demo item."}')
ON CONFLICT DO NOTHING;
-- Keep the sequence in sync with the explicit ids inserted above
SELECT setval('public.items_id_seq', (SELECT COALESCE(MAX(id), 1) FROM public.items));
COMMIT;