-- Admin panel authentication table
CREATE TABLE IF NOT EXISTS tbl_admin_users (
  id INT NOT NULL AUTO_INCREMENT PRIMARY KEY,
  username VARCHAR(100) NOT NULL UNIQUE,
  password_hash VARCHAR(255) NOT NULL,
  created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Create default admin user: username=admin, password=admin123
-- IMPORTANT: change this password after first login.
INSERT INTO tbl_admin_users (username, password_hash)
VALUES ('admin', '$2y$10$2r6mZrVY0o1b8lqM1y6dZe1wlOqUEG4YH1D1W7Kp9T4b5g1K5uF9S')
ON DUPLICATE KEY UPDATE username=username;

-- The password hash above corresponds to: admin123
