
-- Tabel tamu
CREATE TABLE IF NOT EXISTS btm_tamu (
    id_tamu INT AUTO_INCREMENT PRIMARY KEY,
    nama VARCHAR(100) NOT NULL,
    instansi VARCHAR(100),
    tujuan TEXT NOT NULL,
    waktu_datang DATETIME NOT NULL DEFAULT CURRENT_TIMESTAMP
);

-- Tabel admin
CREATE TABLE IF NOT EXISTS btm_admin (
    id_admin INT AUTO_INCREMENT PRIMARY KEY,
    name_lengthap VARCHAR(100) NOT NULL,
    username VARCHAR(50) NOT NULL UNIQUE,
    password VARCHAR(255) NOT NULL
);

-- Insert admin default (password: password)
INSERT INTO btm_admin (name_lengthap, username, password) 
VALUES ('Administrator', 'admin', '$2y$10$92IXUNpkjO0rOQ5byMi.Ye4oKoEa3Ro9llC/.og/at2.uheWG/igi');