서버 환경에서 schema.sql 파일을 찾지 못하는 문제를 해결하기 위해, init_db.php 안에 테이블 생성 쿼리를 직접 포함하도록 수정했습니다.
🤖 Generated with [Claude Code](https://claude.com/claude-code) Co-Authored-By: Claude Sonnet 4.5 <noreply@anthropic.com>
This commit is contained in:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user