diff --git a/misc/update_1.5_to_1.6.sql b/misc/update_1.5_to_1.6.sql index 74b93e9..842df4b 100644 --- a/misc/update_1.5_to_1.6.sql +++ b/misc/update_1.5_to_1.6.sql @@ -13,7 +13,7 @@ INSERT INTO port (id, name, locode) VALUES (1, 'Bremen', 'DEBRE'); -- Adding new ref column to berth ALTER TABLE `bremen_calling_devel`.`berth` -ADD COLUMN `port_id` INT UNSIGNED NOT NULL DEFAULT 1 AFTER `authority_id`; +ADD COLUMN `port_id` INT UNSIGNED DEFAULT NULL AFTER `authority_id`; ALTER TABLE `bremen_calling_devel`.`berth` ALTER INDEX `FK_AUTHORITY_PART_idx` INVISIBLE; -- adding a foreign key berth.port_id -> port.id @@ -52,3 +52,6 @@ CREATE TABLE `participant_port_map` ( CONSTRAINT `FK_PP_PARTICIPANT` FOREIGN KEY (`participant_id`) REFERENCES `participant` (`id`), CONSTRAINT `FK_PP_PORT` FOREIGN KEY (`port_id`) REFERENCES `port` (`id`) ) ENGINE=InnoDB DEFAULT CHARSET=utf8mb4 COLLATE=utf8mb4_0900_ai_ci COMMENT='Mapping table that assigns participants to a port'; + +-- all existing berths shall default to "bremen" +UPDATE berth SET port_id = 1; \ No newline at end of file diff --git a/src/RoleEditor/EditBerthDialog.xaml b/src/RoleEditor/EditBerthDialog.xaml index 234b02b..2fbb4e3 100644 --- a/src/RoleEditor/EditBerthDialog.xaml +++ b/src/RoleEditor/EditBerthDialog.xaml @@ -5,7 +5,7 @@ xmlns:mc="http://schemas.openxmlformats.org/markup-compatibility/2006" xmlns:local="clr-namespace:RoleEditor" mc:Ignorable="d" - Title="Edit berth" Height="188" Width="450" Loaded="Window_Loaded"> + Title="Edit berth" Height="216" Width="450" Loaded="Window_Loaded"> @@ -16,6 +16,7 @@ + @@ -45,7 +46,9 @@