add last updated tracking for secrets
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
@@ -68,6 +68,7 @@ const createSecrets string = `
|
||||
DeviceCategory VARCHAR,
|
||||
UserName VARCHAR,
|
||||
Secret VARCHAR,
|
||||
LastUpdated datetime,
|
||||
FOREIGN KEY (SafeId) REFERENCES safes(SafeId)
|
||||
);
|
||||
`
|
||||
@@ -380,6 +381,16 @@ func CreateTables() {
|
||||
}
|
||||
}
|
||||
|
||||
secretsLastUpdatedCheck, _ := CheckColumnExists("secrets", "LastUpdated")
|
||||
if !secretsLastUpdatedCheck {
|
||||
// Add the column for LastUpdated in the secrets table
|
||||
_, err := db.Exec("ALTER TABLE secrets ADD COLUMN LastUpdated datetime;")
|
||||
if err != nil {
|
||||
log.Printf("Error altering secrets table to add LastUpdated column : '%s'\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
/*
|
||||
// Database updates added after initial version released
|
||||
ldapCheck, _ := CheckColumnExists("roles", "LdapGroup")
|
||||
|
Reference in New Issue
Block a user