DROP TABLE IF EXISTS users;

CREATE TABLE users (
    id INT AUTO_INCREMENT PRIMARY KEY,
    username VARCHAR(50) NOT NULL UNIQUE,
    password VARCHAR(255) NOT NULL,
    role ENUM('student', 'teacher') NOT NULL,
    full_name VARCHAR(100),
    created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP
);

-- Insert a sample teacher user. Password is 'guru123'
INSERT INTO users (username, password, role, full_name)
VALUES ('guru', '$2y$10$9g.8.B6R2.t9.t9.t9.t9.u.j.X.Z.e.f.e.e.e.e.e.e.e', 'teacher', 'Bapak Guru');

-- Insert a sample student user. Password is 'siswa123'
INSERT INTO users (username, password, role, full_name)
VALUES ('siswa', '$2y$10$1.2.3.4.5.6.7.8.9.0.1.2.3.4.5.6.7.8.9.0.1.2', 'student', 'Siswa Rajin');
