mirror of
https://github.com/muety/wakapi.git
synced 2025-12-06 06:22:41 -08:00
chore: consistent indentation [skip-ci]
This commit is contained in:
@@ -1,30 +1,30 @@
|
||||
package migrations
|
||||
|
||||
import (
|
||||
"github.com/muety/wakapi/config"
|
||||
"github.com/muety/wakapi/models"
|
||||
"gorm.io/gorm"
|
||||
"github.com/muety/wakapi/config"
|
||||
"github.com/muety/wakapi/models"
|
||||
"gorm.io/gorm"
|
||||
)
|
||||
|
||||
func init() {
|
||||
const name = "20241220-share_activity_chart_flag"
|
||||
f := migrationFunc{
|
||||
name: name,
|
||||
f: func(db *gorm.DB, cfg *config.Config) error {
|
||||
if hasRun(name, db) {
|
||||
return nil
|
||||
}
|
||||
const name = "20241220-share_activity_chart_flag"
|
||||
f := migrationFunc{
|
||||
name: name,
|
||||
f: func(db *gorm.DB, cfg *config.Config) error {
|
||||
if hasRun(name, db) {
|
||||
return nil
|
||||
}
|
||||
|
||||
db.
|
||||
Model(&models.User{}).
|
||||
Where("share_data_max_days < ?", 0).
|
||||
Or("share_data_max_days >= ?", 365).
|
||||
Update("share_activity_chart", true)
|
||||
db.
|
||||
Model(&models.User{}).
|
||||
Where("share_data_max_days < ?", 0).
|
||||
Or("share_data_max_days >= ?", 365).
|
||||
Update("share_activity_chart", true)
|
||||
|
||||
setHasRun(name, db)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
setHasRun(name, db)
|
||||
return nil
|
||||
},
|
||||
}
|
||||
|
||||
registerPostMigration(f)
|
||||
registerPostMigration(f)
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user