diff options
Diffstat (limited to 'modules-available/permissionmanager/install.inc.php')
-rw-r--r-- | modules-available/permissionmanager/install.inc.php | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/modules-available/permissionmanager/install.inc.php b/modules-available/permissionmanager/install.inc.php index 9e26613d..d0e0a016 100644 --- a/modules-available/permissionmanager/install.inc.php +++ b/modules-available/permissionmanager/install.inc.php @@ -31,7 +31,7 @@ $res[] = tableCreate('role_x_location', " $res[] = tableCreate('role_x_permission', " roleid int(10) unsigned NOT NULL, - permissionid varchar(200) NOT NULL, + permissionid varchar(100) NOT NULL, PRIMARY KEY (roleid, permissionid) "); @@ -109,6 +109,14 @@ if (!tableHasColumn('role', 'builtin')) { $res[] = UPDATE_DONE; } +// 2022-07-06 permissionid too long for older mariadb versions +if (tableColumnType('role_x_permission', 'permissionid') === 'varchar(200)') { + $alter = Database::exec("ALTER TABLE role_x_permission MODIFY permissionid varchar(100) NOT NULL"); + if ($alter === false) + finalResponse(UPDATE_FAILED, 'Cannot shorten permissionid to 100: ' . Database::lastError()); + $res[] = UPDATE_DONE; +} + if (Database::exec("INSERT INTO `role` (roleid, rolename, builtin, roledescription) VALUES (1,'Super-Admin', 1, 'Hat keinerlei Zugriffsbeschränkungen'), (2,'Admin', 1, 'Alles bis auf Rechte-/Nutzerverwaltung'), |