This commit is contained in:
shoopea 2019-07-08 11:49:03 +08:00
parent f110275228
commit 968035909d

5
sql.go
View File

@ -28,9 +28,14 @@ func initDB() {
err = rows.Scan(&name)
failOnError(err, "initDB : show tables listing")
if ok, _ := regexp.MatchString(`^.*_v$`, name); !ok {
_, err = tx.Exec("drop view " + name)
failOnError(err, "initDB : drop view "+name)
} else {
_, err = tx.Exec("drop table " + name)
failOnError(err, "initDB : drop table "+name)
}
}
err = rows.Err()
failOnError(err, "initDB : show tables listing end")
rows.Close()