Update: 2026-06-15 01:37:40
This commit is contained in:
21
backend/migration_create_table.php
Normal file
21
backend/migration_create_table.php
Normal file
@@ -0,0 +1,21 @@
|
||||
<?php
|
||||
require_once __DIR__ . '/core/bootstrap.php';
|
||||
|
||||
try {
|
||||
$con = Database::get('main');
|
||||
$sql = "CREATE TABLE IF NOT EXISTS `passenger_opening_locations` (
|
||||
`id` int NOT NULL AUTO_INCREMENT,
|
||||
`passenger_id` varchar(100) NOT NULL,
|
||||
`latitude` varchar(30) NOT NULL,
|
||||
`longitude` varchar(30) NOT NULL,
|
||||
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
|
||||
PRIMARY KEY (`id`),
|
||||
KEY `idx_passenger_id` (`passenger_id`)
|
||||
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_unicode_ci;";
|
||||
|
||||
$con->exec($sql);
|
||||
echo "SUCCESS: passenger_opening_locations table created successfully.\n";
|
||||
} catch (Exception $e) {
|
||||
echo "ERROR: " . $e->getMessage() . "\n";
|
||||
}
|
||||
?>
|
||||
Reference in New Issue
Block a user