test adding safeid with FK
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:
@@ -238,7 +238,8 @@ func CreateTables() {
|
|||||||
);
|
);
|
||||||
INSERT INTO users SELECT * FROM _users_old;
|
INSERT INTO users SELECT * FROM _users_old;
|
||||||
COMMIT;
|
COMMIT;
|
||||||
PRAGMA foreign_keys=on;
|
PRAGMA foreign_keys=on;
|
||||||
|
DROP TABLE _users_old;
|
||||||
`)
|
`)
|
||||||
if err != nil {
|
if err != nil {
|
||||||
log.Printf("Error altering users table to drop RoleId column : '%s'\n", err)
|
log.Printf("Error altering users table to drop RoleId column : '%s'\n", err)
|
||||||
@@ -256,6 +257,17 @@ func CreateTables() {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// Add SafeId column to secrets table
|
||||||
|
safeIdCheck, _ := CheckColumnExists("secrets", "SafeId")
|
||||||
|
if !safeIdCheck {
|
||||||
|
// Add the column for LdapGroup in the roles table
|
||||||
|
_, err := db.Exec("ALTER TABLE secrets ADD COLUMN SafeId INTEGER REFERENCES safes(SafeId);")
|
||||||
|
if err != nil {
|
||||||
|
log.Printf("Error altering secrets table to add SafeId column : '%s'\n", err)
|
||||||
|
os.Exit(1)
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
// Database updates added after initial version released
|
// Database updates added after initial version released
|
||||||
ldapCheck, _ := CheckColumnExists("roles", "LdapGroup")
|
ldapCheck, _ := CheckColumnExists("roles", "LdapGroup")
|
||||||
|
Reference in New Issue
Block a user