mirror of
https://github.com/pocketbase/pocketbase.git
synced 2025-03-26 16:01:59 +02:00
don't skip temp indexes migration if the indexes column is already created
This commit is contained in:
parent
0351f3a1ad
commit
5ddf9cd443
@ -42,14 +42,19 @@ func init() {
|
||||
return err
|
||||
}
|
||||
|
||||
var hasIndexesColumn bool
|
||||
for _, col := range cols {
|
||||
if col == "indexes" {
|
||||
return nil // already existing (probably via the init migration)
|
||||
// already existing (probably via the init migration)
|
||||
hasIndexesColumn = true
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
if _, err := db.AddColumn("_collections", "indexes", `JSON DEFAULT "[]" NOT NULL`).Execute(); err != nil {
|
||||
return err
|
||||
if !hasIndexesColumn {
|
||||
if _, err := db.AddColumn("_collections", "indexes", `JSON DEFAULT "[]" NOT NULL`).Execute(); err != nil {
|
||||
return err
|
||||
}
|
||||
}
|
||||
|
||||
collections := []*models.Collection{}
|
||||
|
Loading…
x
Reference in New Issue
Block a user