mirror of
https://github.com/drakkan/sftpgo.git
synced 2025-12-08 07:10:56 +03:00
add support for integrated database schema migrations
added the "initprovider" command to initialize the database structure. If we change the database schema the required changes will be checked at startup and automatically applyed.
This commit is contained in:
@@ -79,3 +79,11 @@ func getUpdateUserQuery() string {
|
||||
func getDeleteUserQuery() string {
|
||||
return fmt.Sprintf(`DELETE FROM %v WHERE id = %v`, config.UsersTable, sqlPlaceholders[0])
|
||||
}
|
||||
|
||||
func getDatabaseVersionQuery() string {
|
||||
return "SELECT version from schema_version LIMIT 1"
|
||||
}
|
||||
|
||||
func getUpdateDBVersionQuery() string {
|
||||
return fmt.Sprintf(`UPDATE schema_version SET version=%v`, sqlPlaceholders[0])
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user