fix lastupdated definition
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-16 16:22:45 +11:00
parent b278a3c7d8
commit 97cd75b0d7

View File

@@ -68,7 +68,7 @@ const createSecrets string = `
DeviceCategory VARCHAR, DeviceCategory VARCHAR,
UserName VARCHAR, UserName VARCHAR,
Secret VARCHAR, Secret VARCHAR,
LastUpdated datetime, LastUpdated datetime DEFAULT 0,
FOREIGN KEY (SafeId) REFERENCES safes(SafeId) FOREIGN KEY (SafeId) REFERENCES safes(SafeId)
); );
` `
@@ -384,7 +384,7 @@ func CreateTables() {
secretsLastUpdatedCheck, _ := CheckColumnExists("secrets", "LastUpdated") secretsLastUpdatedCheck, _ := CheckColumnExists("secrets", "LastUpdated")
if !secretsLastUpdatedCheck { if !secretsLastUpdatedCheck {
// Add the column for LastUpdated in the secrets table // Add the column for LastUpdated in the secrets table
_, err := db.Exec("ALTER TABLE secrets ADD COLUMN LastUpdated datetime;") _, err := db.Exec("ALTER TABLE secrets ADD COLUMN LastUpdated datetime DEFAULT 0;")
if err != nil { if err != nil {
log.Printf("Error altering secrets table to add LastUpdated column : '%s'\n", err) log.Printf("Error altering secrets table to add LastUpdated column : '%s'\n", err)
os.Exit(1) os.Exit(1)