From 6362f47d436657d69c6ac7ce225b3aedf99532a0 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 13 Oct 2025 17:37:59 +0200 Subject: [PATCH] Updated project settings, removed participant 'active' and fixed user delete --- misc/create_schema.sql | 19 +++++++++++++++++++ src/RoleEditor/App.config | 2 +- src/RoleEditor/MainWindow.xaml | 6 +++--- src/RoleEditor/MainWindow.xaml.cs | 14 +++++++++++--- src/RoleEditor/RoleEditor.csproj | 6 +++--- src/brecal.model/DbEntity.cs | 18 ++++++++++++------ src/brecal.model/Participant.cs | 9 ++++++--- src/brecal.model/User.cs | 10 ++++++++++ src/brecal.model/brecal.model.csproj | 2 +- src/brecal.mysql/brecal.mysql.csproj | 4 ++-- 10 files changed, 68 insertions(+), 22 deletions(-) diff --git a/misc/create_schema.sql b/misc/create_schema.sql index adbe508..5f9764c 100644 --- a/misc/create_schema.sql +++ b/misc/create_schema.sql @@ -39,6 +39,25 @@ CREATE TABLE `berth` ( ) ENGINE=InnoDB AUTO_INCREMENT=195 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Berth of ship for a ship call'; /*!40101 SET character_set_client = @saved_cs_client */; +CREATE TABLE `history` ( + `id` int unsigned NOT NULL AUTO_INCREMENT, + `participant_id` int unsigned NOT NULL, + `user_id` int unsigned DEFAULT NULL, + `shipcall_id` int unsigned NOT NULL, + `timestamp` datetime NOT NULL COMMENT 'Time of saving', + `eta` datetime DEFAULT NULL COMMENT 'Current ETA / ETD value (depends if shipcall or times were saved)', + `type` int NOT NULL COMMENT 'shipcall or times', + `operation` int NOT NULL COMMENT 'insert, update or delete', + PRIMARY KEY (`id`), + KEY `FK_HISTORY_PARTICIPANT_idx` (`participant_id`), + KEY `FK_HISTORY_SHIPCALL_idx` (`shipcall_id`), + KEY `FK_HISTORY_USER` (`user_id`), + CONSTRAINT `FK_HISTORY_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`), + CONSTRAINT `FK_HISTORY_SHIPCALL` FOREIGN KEY (`shipcall_id`) REFERENCES `shipcall` (`id`), + CONSTRAINT `FK_HISTORY_USER` FOREIGN KEY (`user_id`) REFERENCES `user` (`id`) +) ENGINE=InnoDB AUTO_INCREMENT=29292 DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='This table stores a history of changes made to shipcalls so that everyone can see who changed what and when'; + + -- -- Table structure for table `notification` -- diff --git a/src/RoleEditor/App.config b/src/RoleEditor/App.config index 51c1ce1..2ba1186 100644 --- a/src/RoleEditor/App.config +++ b/src/RoleEditor/App.config @@ -8,7 +8,7 @@ - Server=localhost;User ID=ds;Password=HalloWach_2323XXL!!;Database=bremen_calling_devel;Port=33306 + Server=localhost;User ID=ds;Password=HalloWach_2323XXL!!;Database=bremen_calling_test;Port=33307 diff --git a/src/RoleEditor/MainWindow.xaml b/src/RoleEditor/MainWindow.xaml index 5dde421..76d287a 100644 --- a/src/RoleEditor/MainWindow.xaml +++ b/src/RoleEditor/MainWindow.xaml @@ -59,7 +59,7 @@