erp-construccion-database-v2/insert_admin_user.sql
Adrian Flores Cortes 5f009673aa [REMEDIATION] feat: Database schema updates and recreate script enhancement
Major overhaul of drop-and-recreate-database.sh, DDL schema updates,
seed data cleanup. Add utility scripts for auth table fixes.

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
2026-02-05 23:18:19 -06:00

22 lines
656 B
SQL

INSERT INTO auth.users (
id, tenant_id, email, password_hash, first_name, last_name,
is_active, email_verified, roles, default_tenant_id, created_at, updated_at
)
VALUES (
'b0eebc99-9c0b-4ef8-bb6d-6bb9bd380a22',
'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
'admin@test.com',
'$2a$10$4M7jT3YmH14xyx3L7uojmuRFyggZcM/qb8A/54B2XXDtYBmVI7/J2',
'Admin',
'User',
true,
true,
ARRAY['admin']::VARCHAR[],
'a0eebc99-9c0b-4ef8-bb6d-6bb9bd380a11',
NOW(),
NOW()
) ON CONFLICT (id) DO UPDATE SET
password_hash = EXCLUDED.password_hash,
roles = EXCLUDED.roles,
default_tenant_id = EXCLUDED.default_tenant_id;