USE panelgame;

-- Jalankan file ini kalau database sudah terlanjur dibuat dan login admin/reseller tetap salah.
-- Admin: admin@gmail.com / admin123
-- Reseller: reseller@gmail.com / reseller123

INSERT INTO users (email, password_hash, role, balance_cents, saldo, active, register_hash, login_token)
VALUES
('admin@gmail.com', '$2y$12$RMxWiKoUAcEkgnf/O04ezu9zrkThTP3c1hUHIicUQ7whOCGSsqMrm', 'admin', 100000, 100000, 1, 'ADMIN-SEED', NULL),
('reseller@gmail.com', '$2y$12$LdnvQCaPYC6HFAPLOc/45.YMjgTKks4HTdd17CQgqf.1gja8fUDTC', 'reseller', 50000, 50000, 1, 'RESELLER-SEED', NULL)
ON DUPLICATE KEY UPDATE
password_hash=VALUES(password_hash),
role=VALUES(role),
balance_cents=VALUES(balance_cents),
saldo=VALUES(saldo),
active=1,
register_hash=VALUES(register_hash),
login_token=NULL;

INSERT INTO register_hashes (hash_code, balance_cents, role, max_uses, used_count, active)
VALUES
('RESELLER100', 10000, 'reseller', 100, 0, 1),
('USER10', 1000, 'user', 100, 0, 1)
ON DUPLICATE KEY UPDATE
balance_cents=VALUES(balance_cents),
role=VALUES(role),
max_uses=VALUES(max_uses),
active=1;
