mirror of https://github.com/muety/wakapi.git
Compare commits
2 Commits
938290b2da
...
eca443be35
Author | SHA1 | Date |
---|---|---|
Ferdinand Mütsch | eca443be35 | |
Christoph Brand | 04ec44dcef |
|
@ -1,12 +1,13 @@
|
||||||
package migrations
|
package migrations
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"regexp"
|
||||||
|
"strings"
|
||||||
|
|
||||||
"github.com/emvi/logbuch"
|
"github.com/emvi/logbuch"
|
||||||
"github.com/muety/wakapi/config"
|
"github.com/muety/wakapi/config"
|
||||||
"github.com/muety/wakapi/models"
|
"github.com/muety/wakapi/models"
|
||||||
"gorm.io/gorm"
|
"gorm.io/gorm"
|
||||||
"regexp"
|
|
||||||
"strings"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
// due to an error in the model definition, idx_time_user used to only cover 'user_id', but not time column
|
// due to an error in the model definition, idx_time_user used to only cover 'user_id', but not time column
|
||||||
|
@ -37,7 +38,7 @@ func init() {
|
||||||
}
|
}
|
||||||
|
|
||||||
matches := regexp.MustCompile("(?i)\\((.+)\\)$").FindStringSubmatch(ddl)
|
matches := regexp.MustCompile("(?i)\\((.+)\\)$").FindStringSubmatch(ddl)
|
||||||
if len(matches) > 0 && !strings.Contains(matches[0], "`user_id`") || !strings.Contains(matches[0], "`time`") {
|
if len(matches) > 0 && (!strings.Contains(matches[0], "`user_id`") || !strings.Contains(matches[0], "`time`")) {
|
||||||
drop = true
|
drop = true
|
||||||
}
|
}
|
||||||
} else {
|
} else {
|
||||||
|
|
Loading…
Reference in New Issue