feat(udt-001): db schema for Usuario with admin seed

This commit is contained in:
2026-04-13 21:35:55 -03:00
parent c666729685
commit 1e5cac737b
2 changed files with 73 additions and 0 deletions

View File

@@ -0,0 +1,30 @@
-- S001__seed_admin.sql
-- Seeds the default admin user for SIG-CM2
-- BCrypt hash of '@Diego550@' at cost 12
-- Generated: 2026-04-13
SET QUOTED_IDENTIFIER ON;
SET ANSI_NULLS ON;
SET NOCOUNT ON;
GO
IF NOT EXISTS (SELECT 1 FROM dbo.Usuario WHERE Username = 'admin')
BEGIN
INSERT INTO dbo.Usuario (Username, PasswordHash, Nombre, Apellido, Email, Rol, PermisosJson, Activo)
VALUES (
'admin',
'$2a$12$rmq6tlSAQ8WXhR2CwLCSeuwCJKz/.8Eab95UQCUNfwe4dokeOqMcW',
'Administrador',
'Sistema',
NULL,
'admin',
'["*"]',
1
);
PRINT 'Admin user seeded successfully.';
END
ELSE
BEGIN
PRINT 'Admin user already exists — skipping.';
END
GO