refactor: make poverty map public and remove redundant user authentication requirements
This commit is contained in:
+14
-1
@@ -24,4 +24,17 @@ $sql2 = "CREATE TABLE IF NOT EXISTS penduduk_miskin (
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;";
|
||||
$c->query($sql2);
|
||||
|
||||
echo 'Tables OK';
|
||||
$sql3 = "CREATE TABLE IF NOT EXISTS users (
|
||||
id INT NOT NULL AUTO_INCREMENT,
|
||||
username VARCHAR(50) NOT NULL UNIQUE,
|
||||
password VARCHAR(255) NOT NULL,
|
||||
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (id)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;";
|
||||
$c->query($sql3);
|
||||
|
||||
$passwordHash = password_hash('admin123', PASSWORD_DEFAULT);
|
||||
$insertAdmin = "INSERT IGNORE INTO users (username, password) VALUES ('admin', '$passwordHash')";
|
||||
$c->query($insertAdmin);
|
||||
|
||||
echo 'Tables and Admin User OK';
|
||||
|
||||
Reference in New Issue
Block a user