fix LastUpdated default value
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
2024-01-16 16:35:28 +11:00
parent 97cd75b0d7
commit f29c733080

View File

@@ -68,7 +68,7 @@ const createSecrets string = `
DeviceCategory VARCHAR, DeviceCategory VARCHAR,
UserName VARCHAR, UserName VARCHAR,
Secret VARCHAR, Secret VARCHAR,
LastUpdated datetime DEFAULT 0, LastUpdated datetime DEFAULT (datetime('1970-01-01 00:00:00')),
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 DEFAULT 0;") _, err := db.Exec("ALTER TABLE secrets ADD COLUMN LastUpdated datetime DEFAULT (datetime('1970-01-01 00:00:00'));")
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)