Änderung: Hinzufügung der Ampel-Logik zur Taxi-Map
Änderungen: - Erweiterung des TaxiMapTile-Modells um die Spalte trafficLight zur Verwaltung von Ampelzuständen. - Anpassung der TaxiMapService-Logik zur Unterstützung der Ampel-Updates und -Zustände. - Implementierung von Methoden zur Steuerung und Anzeige von Ampeln in der Benutzeroberfläche, einschließlich der neuen Funktionen in TaxiToolsView.vue und TaxiGame.vue. - Verbesserung der Darstellung und Logik zur Ampelsteuerung im Spiel, einschließlich der visuellen Darstellung und der Interaktion mit Ampeln. Diese Anpassungen verbessern die Funktionalität und Benutzererfahrung im Taxi-Minispiel erheblich, indem sie eine realistischere Verkehrssteuerung ermöglichen.
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
// syncDatabase.js
|
||||
|
||||
import { initializeDatabase, syncModelsWithUpdates, syncModelsAlways } from './sequelize.js';
|
||||
import { initializeDatabase, syncModelsWithUpdates, syncModelsAlways, sequelize } from './sequelize.js';
|
||||
import initializeTypes from './initializeTypes.js';
|
||||
import initializeSettings from './initializeSettings.js';
|
||||
import initializeUserRights from './initializeUserRights.js';
|
||||
@@ -33,11 +33,32 @@ const syncDatabase = async () => {
|
||||
console.log("Initializing database schemas...");
|
||||
await initializeDatabase();
|
||||
|
||||
console.log("Synchronizing models...");
|
||||
await syncModelsWithUpdates(models);
|
||||
// Vorab: Stelle kritische Spalten sicher, damit Index-Erstellung nicht fehlschlägt
|
||||
console.log("Pre-ensure Taxi columns (traffic_light) ...");
|
||||
try {
|
||||
await sequelize.query(`
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_schema = 'taxi' AND table_name = 'taxi_map_tile' AND column_name = 'traffic_light'
|
||||
) THEN
|
||||
ALTER TABLE taxi.taxi_map_tile
|
||||
ADD COLUMN traffic_light BOOLEAN NOT NULL DEFAULT false;
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
`);
|
||||
console.log("✅ traffic_light-Spalte ist vorhanden");
|
||||
} catch (e) {
|
||||
console.warn('⚠️ Konnte traffic_light-Spalte nicht vorab sicherstellen:', e?.message || e);
|
||||
}
|
||||
|
||||
console.log("Setting up associations...");
|
||||
setupAssociations();
|
||||
setupAssociations();
|
||||
|
||||
console.log("Synchronizing models...");
|
||||
await syncModelsWithUpdates(models);
|
||||
|
||||
console.log("Initializing settings...");
|
||||
await initializeSettings();
|
||||
@@ -91,11 +112,32 @@ const syncDatabaseForDeployment = async () => {
|
||||
console.log("Initializing database schemas...");
|
||||
await initializeDatabase();
|
||||
|
||||
console.log("Synchronizing models with schema updates...");
|
||||
await syncModelsAlways(models);
|
||||
// Vorab: Stelle kritische Spalten sicher, damit Index-Erstellung nicht fehlschlägt
|
||||
console.log("Pre-ensure Taxi columns (traffic_light) ...");
|
||||
try {
|
||||
await sequelize.query(`
|
||||
DO $$
|
||||
BEGIN
|
||||
IF NOT EXISTS (
|
||||
SELECT 1 FROM information_schema.columns
|
||||
WHERE table_schema = 'taxi' AND table_name = 'taxi_map_tile' AND column_name = 'traffic_light'
|
||||
) THEN
|
||||
ALTER TABLE taxi.taxi_map_tile
|
||||
ADD COLUMN traffic_light BOOLEAN NOT NULL DEFAULT false;
|
||||
END IF;
|
||||
END
|
||||
$$;
|
||||
`);
|
||||
console.log("✅ traffic_light-Spalte ist vorhanden");
|
||||
} catch (e) {
|
||||
console.warn('⚠️ Konnte traffic_light-Spalte nicht vorab sicherstellen:', e?.message || e);
|
||||
}
|
||||
|
||||
console.log("Setting up associations...");
|
||||
setupAssociations();
|
||||
setupAssociations();
|
||||
|
||||
console.log("Synchronizing models with schema updates...");
|
||||
await syncModelsAlways(models);
|
||||
|
||||
console.log("Initializing settings...");
|
||||
await initializeSettings();
|
||||
|
||||
Reference in New Issue
Block a user