[#7689] fixed indexes update collection error
This commit is contained in:
@@ -306,8 +306,10 @@ func dropCollectionIndexes(app App, collection *Collection) error {
|
||||
for _, raw := range collection.Indexes {
|
||||
parsed := dbutils.ParseIndex(raw)
|
||||
|
||||
if !parsed.IsValid() {
|
||||
continue
|
||||
// note: don't check IsValid because the index table name may not be populated
|
||||
// (https://github.com/pocketbase/pocketbase/issues/7689)
|
||||
if parsed.IndexName == "" {
|
||||
return fmt.Errorf("failed to dop index - missing index name: %s", raw)
|
||||
}
|
||||
|
||||
_, err := txApp.DB().NewQuery(fmt.Sprintf("DROP INDEX IF EXISTS [[%s]]", parsed.IndexName)).Execute()
|
||||
|
||||
Reference in New Issue
Block a user