use log rather than fmt
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:
@@ -58,6 +58,14 @@ const createSchema string = `
|
||||
);
|
||||
`
|
||||
|
||||
const createAudit string = `
|
||||
CREATE TABLE IF NOT EXISTS audit (
|
||||
UserName VARCHAR,
|
||||
EventText VARCHAR,
|
||||
EventTime INTEGER
|
||||
);
|
||||
`
|
||||
|
||||
// Establish connection to sqlite database
|
||||
func ConnectDatabase() {
|
||||
var err error
|
||||
@@ -145,12 +153,18 @@ func CreateTables() {
|
||||
}
|
||||
schemaCheck, _ := CheckColumnExists("schema", "Version")
|
||||
if !schemaCheck {
|
||||
if _, err = db.Exec("INSERT INTO schema VALUES(1);"); err != nil {
|
||||
if _, err = db.Exec("INSERT INTO schema VALUES(2);"); err != nil {
|
||||
log.Printf("Error adding initial schema version : '%s'", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
// Audit log table
|
||||
if _, err = db.Exec(createAudit); err != nil {
|
||||
log.Printf("Error checking audit table : '%s'", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
|
||||
// Database updates added after initial version released
|
||||
ldapCheck, _ := CheckColumnExists("roles", "LdapGroup")
|
||||
|
||||
|
Reference in New Issue
Block a user