From c9aa4397124e64c91fd5551d72787280c0f0f5b2 Mon Sep 17 00:00:00 2001 From: Daniel Schick Date: Mon, 17 Apr 2023 07:49:27 +0200 Subject: [PATCH] saving securables, more logic --- misc/create_schema.sql | 3 +- src/RoleEditor/MainWindow.xaml | 6 ++-- src/RoleEditor/MainWindow.xaml.cs | 8 +++-- src/brecal.model/Securable.cs | 59 +++++++++++++++++++++++++++++-- src/brecal.mysql/DBManager.cs | 2 +- 5 files changed, 67 insertions(+), 11 deletions(-) diff --git a/misc/create_schema.sql b/misc/create_schema.sql index 7bf326f..e8e7676 100644 --- a/misc/create_schema.sql +++ b/misc/create_schema.sql @@ -101,7 +101,6 @@ CREATE TABLE `participant` ( `street` VARCHAR(128) NULL DEFAULT NULL, `postal_code` VARCHAR(5) NULL DEFAULT NULL, `city` VARCHAR(64) NULL DEFAULT NULL, - `roles` INT(10) UNSIGNED NULL DEFAULT 0 COMMENT 'Bitarray of assigned roles', `flags` INT(10) UNSIGNED NULL DEFAULT NULL, `created` DATETIME NULL DEFAULT current_timestamp(), `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), @@ -187,7 +186,7 @@ ENGINE=InnoDB CREATE TABLE `securable` ( - `id` INT(10) UNSIGNED NOT NULL, + `id` INT(10) UNSIGNED NOT NULL AUTO_INCREMENT, `name` VARCHAR(50) NOT NULL DEFAULT '', `created` DATETIME NULL DEFAULT current_timestamp(), `modified` DATETIME NULL DEFAULT NULL ON UPDATE current_timestamp(), diff --git a/src/RoleEditor/MainWindow.xaml b/src/RoleEditor/MainWindow.xaml index 8d24419..a8662ba 100644 --- a/src/RoleEditor/MainWindow.xaml +++ b/src/RoleEditor/MainWindow.xaml @@ -174,8 +174,8 @@