diff --git a/barobill_registration/init_db.php b/barobill_registration/init_db.php index ace1ac3..a8da419 100644 --- a/barobill_registration/init_db.php +++ b/barobill_registration/init_db.php @@ -6,11 +6,24 @@ try { require_once("../lib/mydb.php"); $pdo = db_connect(); - $schemaPath = __DIR__ . "/schema.sql"; - if (!file_exists($schemaPath)) { - throw new Exception("schema.sql file not found at: " . $schemaPath); - } - $sql = file_get_contents($schemaPath); + + $sql = "CREATE TABLE IF NOT EXISTS barobill_members ( + id INT AUTO_INCREMENT PRIMARY KEY, + biz_no VARCHAR(20) NOT NULL UNIQUE, + corp_name VARCHAR(100) NOT NULL, + ceo_name VARCHAR(50) NOT NULL, + addr VARCHAR(255), + biz_type VARCHAR(50), + biz_class VARCHAR(50), + barobill_id VARCHAR(50) NOT NULL, + barobill_pwd VARCHAR(100), + manager_name VARCHAR(50), + manager_email VARCHAR(100), + manager_hp VARCHAR(20), + created_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP, + updated_at TIMESTAMP DEFAULT CURRENT_TIMESTAMP ON UPDATE CURRENT_TIMESTAMP + ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4;"; + $pdo->exec($sql); echo "Table 'barobill_members' initialized successfully."; } catch (Throwable $e) {