-- ============================================================
-- CalendarReminder — vytvorenie admin používateľa
-- Heslo: Admin@2025
-- Spusti: mysql -h 192.168.1.68 -u mip -p"mip@2013" calendarreminder < create-admin.sql
-- ============================================================

INSERT INTO Users (Username, Email, PasswordHash, IsAdmin, MustChangePassword, CreatedAt)
VALUES (
    'admin',
    'nas@culak.sk',
    '$2a$11$8yPi0lcuKsJH6/Ncvm2A6O4Nw9gZblkCZ23PxbibW5MVfG06syp5S',
    1,
    0,
    UTC_TIMESTAMP()
)
ON DUPLICATE KEY UPDATE
    Email        = VALUES(Email),
    PasswordHash = VALUES(PasswordHash),
    IsAdmin      = 1;

-- Over výsledok
SELECT Id, Username, Email, IsAdmin, MustChangePassword FROM Users WHERE Username = 'admin';
