1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-08-12 18:46:24 -07:00

Started work on migration script for old database

This commit is contained in:
comraderat 2020-05-30 22:43:01 +02:00
parent f0c1fbba94
commit c84b27d7ce
4 changed files with 86 additions and 4 deletions

View file

@ -69,8 +69,11 @@ func initDB(initFile string) *gcutil.GcError {
return gcutil.NewError(fmt.Sprintf(
"SQL database initialization file (%s) missing. Please reinstall gochan", initFile), false)
}
return runSQLFile(filePath)
}
sqlBytes, err := ioutil.ReadFile(filePath)
func runSQLFile(path string) *gcutil.GcError {
sqlBytes, err := ioutil.ReadFile(path)
if err != nil {
return gcutil.FromError(err, false)
}