store ldap user in database
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-05 10:14:54 +11:00
parent cb7376eeeb
commit b51468db8c
2 changed files with 22 additions and 16 deletions

View File

@@ -26,7 +26,7 @@ const createRoles string = `
RoleName VARCHAR,
ReadOnly BOOLEAN,
Admin BOOLEAN,
LdapGroup VARCHAR
LdapGroup VARCHAR DEFAULT ''
);
`
@@ -172,7 +172,7 @@ func CreateTables() {
if !ldapCheck {
// Add the column for LdapGroup in the roles table
_, err := db.Exec("ALTER TABLE roles ADD COLUMN LdapGroup VARCHAR;")
_, err := db.Exec("ALTER TABLE roles ADD COLUMN LdapGroup VARCHAR DEFAULT '';")
if err != nil {
log.Printf("Error altering roles table to add LdapGroup column : '%s'\n", err)
os.Exit(1)