feat: tambah skrip migrasi database otomatis

This commit is contained in:
2026-06-10 00:53:50 +07:00
parent 16177783fd
commit f83b1c675f
7 changed files with 398 additions and 12 deletions
+13 -4
View File
@@ -1,9 +1,18 @@
<?php
$host_sekarang = $_SERVER['SERVER_NAME'];
$host = "localhost";
$user = "root";
$pass = "";
$db = "webgis_db_pertemuan2";
if ($host_sekarang === 'localhost' || $host_sekarang === '127.0.0.1') {
$host = "localhost";
$user = "root";
$pass = "";
$db = "webgis_db_pertemuan2";
} else {
// Gunakan Kredensial Normal User dari Coolify
$host = "mysql-webgis";
$user = "root"; // Menggunakan root user
$pass = "yg7eDOyhmHwJaR93A1SdPawY3533dFd8GlIVnVezQiV3IWR5DDc7ApQeIkzKneGL"; // Root User Password
$db = "webgis_db_pertemuan2";
}
// Connect first without DB to ensure we can create it if missing