Fix old database check
ci/woodpecker/push/woodpecker Pipeline was successful
Details
ci/woodpecker/push/woodpecker Pipeline was successful
Details
This commit is contained in:
parent
efca9d116e
commit
3829dc4cc4
|
@ -14,13 +14,11 @@ var gdb *sqlx.DB
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
fi, err := os.Stat(config.DBPath)
|
fi, err := os.Stat(config.DBPath)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
log.Fatal("Cannot stat database path").Err(err).Send()
|
// TODO: This should be removed by the first stable release.
|
||||||
}
|
if fi.IsDir() {
|
||||||
|
log.Fatal("Your package cache database is using the old database engine. Please remove ~/.cache/lure and then run `lure ref`.").Send()
|
||||||
// TODO: This should be removed by the first stable release.
|
}
|
||||||
if fi.IsDir() {
|
|
||||||
log.Fatal("Your package cache database is using the old database engine. Please remove ~/.cache/lure and then run `lure ref`.").Send()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlite.MustRegisterScalarFunction("json_array_contains", 2, db.JsonArrayContains)
|
sqlite.MustRegisterScalarFunction("json_array_contains", 2, db.JsonArrayContains)
|
||||||
|
|
12
db.go
12
db.go
|
@ -14,13 +14,11 @@ var gdb *sqlx.DB
|
||||||
|
|
||||||
func init() {
|
func init() {
|
||||||
fi, err := os.Stat(config.DBPath)
|
fi, err := os.Stat(config.DBPath)
|
||||||
if err != nil {
|
if err == nil {
|
||||||
log.Fatal("Cannot stat database path").Err(err).Send()
|
// TODO: This should be removed by the first stable release.
|
||||||
}
|
if fi.IsDir() {
|
||||||
|
log.Fatal("Your package cache database is using the old database engine. Please remove ~/.cache/lure and then run `lure ref`.").Send()
|
||||||
// TODO: This should be removed by the first stable release.
|
}
|
||||||
if fi.IsDir() {
|
|
||||||
log.Fatal("Your package cache database is using the old database engine. Please remove ~/.cache/lure and then run `lure ref`.").Send()
|
|
||||||
}
|
}
|
||||||
|
|
||||||
sqlite.MustRegisterScalarFunction("json_array_contains", 2, db.JsonArrayContains)
|
sqlite.MustRegisterScalarFunction("json_array_contains", 2, db.JsonArrayContains)
|
||||||
|
|
Loading…
Reference in New Issue