fix: only drop Vikunja-owned tables in WipeEverything

Previously WipeEverything used x.DBMetas() which returns all tables
in the database, including those owned by PostgreSQL extensions like
PostGIS. This caused restore to fail with 'cannot drop table
spatial_ref_sys because extension postgis requires it'.

Now uses the registered table list instead.

Fixes go-vikunja/vikunja#2219
This commit is contained in:
kolaente 2026-03-04 15:27:12 +01:00
parent 0a8534ded9
commit 14e2c95a83
1 changed files with 3 additions and 9 deletions

View File

@ -428,16 +428,10 @@ func isSystemDirectory(path string) bool {
return false
}
// WipeEverything wipes all tables and their data. Use with caution...
// WipeEverything wipes all Vikunja tables and their data. Use with caution...
func WipeEverything() error {
tables, err := x.DBMetas()
if err != nil {
return err
}
for _, t := range tables {
if err := x.DropTables(t.Name); err != nil {
for _, name := range RegisteredTableNames() {
if err := x.DropTables(name); err != nil {
return err
}
}