Initial commit: Estructura backend y frontend con estándar VPS
- Backend migrado a estructura VPS (src/ subfolder) - Frontend con estructura Vite + React 19 + Tailwind - Configuración PostgreSQL con Pool - API service con interceptores JWT - Ambos servidores funcionando (backend:3001, frontend:5173)
This commit is contained in:
38
backend/migrations/003_create_admin_user.sql
Normal file
38
backend/migrations/003_create_admin_user.sql
Normal file
@@ -0,0 +1,38 @@
|
||||
-- ================================================
|
||||
-- CREAR USUARIO ADMINISTRADOR
|
||||
-- Ejecutar en la base de datos ofertaweb
|
||||
-- ================================================
|
||||
|
||||
-- Usuario: admin@ofertaweb.cl
|
||||
-- Contraseña: admin123
|
||||
-- Hash bcrypt generado con bcryptjs (10 rounds)
|
||||
|
||||
INSERT INTO users (
|
||||
email,
|
||||
password_hash,
|
||||
nombre,
|
||||
apellido,
|
||||
telefono,
|
||||
role,
|
||||
is_active,
|
||||
email_verificado
|
||||
) VALUES (
|
||||
'admin@ofertaweb.cl',
|
||||
'$2a$10$zt.nWuEczQFQAwFFjuuPX.cx6cgSqSYZpYmcaEZdRSn5XRNVFI4YS',
|
||||
'Administrador',
|
||||
'Sistema',
|
||||
'+56912345678',
|
||||
'admin',
|
||||
true,
|
||||
true
|
||||
)
|
||||
ON CONFLICT (email) DO UPDATE SET
|
||||
password_hash = EXCLUDED.password_hash,
|
||||
role = EXCLUDED.role,
|
||||
is_active = EXCLUDED.is_active,
|
||||
email_verificado = EXCLUDED.email_verificado;
|
||||
|
||||
-- Verificar que se creó
|
||||
SELECT id, email, nombre, apellido, role, is_active, email_verificado, created_at
|
||||
FROM users
|
||||
WHERE email = 'admin@ofertaweb.cl';
|
||||
Reference in New Issue
Block a user