query(file_get_contents(__DIR__.'/../dashboard/migrations/001_admin.sql')); if(one("SHOW COLUMNS FROM rec_admin LIKE 'name'")) db()->query(file_get_contents(__DIR__.'/../dashboard/migrations/002_admin_identity.sql')); if(!one('SELECT id FROM rec_admin WHERE email=?','s',[getenv('LOCAL_ADMIN_EMAIL')])) query('INSERT INTO rec_admin(email,nama_de,nama_be,idkar,password_hash) VALUES(?,?,?,?,?)','sssss',[getenv('LOCAL_ADMIN_EMAIL'),'Admin','Nurinda','LOCAL-001',password_hash(getenv('LOCAL_ADMIN_PASSWORD'),PASSWORD_DEFAULT)]); foreach (array_filter(array_map("trim", explode(";", file_get_contents(__DIR__."/../dashboard/migrations/003_exam_attempts.sql")))) as $sql) db()->query($sql);