Update: 2026-08-01 23:53:33

This commit is contained in:
Hamza-Ayed
2026-08-01 23:53:34 +03:00
parent 940b69a554
commit cbaf638abf
4 changed files with 67 additions and 3 deletions
+30
View File
@@ -153,3 +153,33 @@ foreach ($defaultPricing as $row) {
}
echo "Kazan seeding completed.\n";
// Also ensure ride_chat_logs table exists in main DB and ride DB
$sqlCreateChat = "CREATE TABLE IF NOT EXISTS `ride_chat_logs` (
`id` bigint UNSIGNED NOT NULL AUTO_INCREMENT,
`ride_id` int NOT NULL,
`sender_id` varchar(111) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`receiver_id` varchar(111) CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`sender_type` enum('passenger','driver') CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`message_content` text CHARACTER SET utf8mb4 COLLATE utf8mb4_general_ci NOT NULL,
`created_at` timestamp NOT NULL DEFAULT CURRENT_TIMESTAMP,
PRIMARY KEY (`id`),
KEY `idx_ride_id` (`ride_id`),
KEY `idx_created_at` (`created_at`)
) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_general_ci;";
try {
$con->exec($sqlCreateChat);
echo "Successfully created/verified `ride_chat_logs` table in main DB.\n";
} catch (Exception $e) {
echo "Error creating `ride_chat_logs` in main DB: " . $e->getMessage() . "\n";
}
try {
$con_ride = Database::get('ride');
$con_ride->exec($sqlCreateChat);
echo "Successfully created/verified `ride_chat_logs` table in ride DB.\n";
} catch (Exception $e) {
echo "Error creating `ride_chat_logs` in ride DB: " . $e->getMessage() . "\n";
}