veylant/migrations/000012_users_add_name.up.sql
2026-03-10 09:20:38 +01:00

10 lines
525 B
SQL

-- Migration 000012: Add name column to users table.
-- Migration 000001 created users without a name column; migration 000006 used
-- CREATE TABLE IF NOT EXISTS which was a no-op since the table already existed.
-- This migration adds the missing column retroactively and seeds existing users.
ALTER TABLE users ADD COLUMN IF NOT EXISTS name TEXT NOT NULL DEFAULT '';
-- Seed name for the dev admin user created in migration 000001.
UPDATE users SET name = 'Admin Veylant' WHERE email = 'admin@veylant.dev' AND name = '';