1
0
Fork 0
mirror of https://github.com/Eggbertx/gochan.git synced 2025-09-10 02:26:23 -07:00

Move database schema updating to gochan-migration

This commit is contained in:
Eggbertx 2023-04-07 14:34:28 -07:00
parent 1da4330780
commit 17c28e5ebe
8 changed files with 260 additions and 119 deletions

View file

@ -24,7 +24,7 @@ func RunSQLFile(path string, db *gcsql.GCDB) error {
sqlArr := strings.Split(sqlStr, ";")
for _, statement := range sqlArr {
statement = strings.Trim(statement, " \n\r\t")
statement = strings.TrimSpace(statement)
if len(statement) > 0 {
if _, err = db.ExecSQL(statement); err != nil {
return err