mirror of
https://github.com/usual2970/certimate.git
synced 2025-06-09 05:59:50 +00:00
fix: conflict pocketbase superuser initializations
This commit is contained in:
parent
d11fc1c07e
commit
98f4f1cc99
3
main.go
3
main.go
@ -18,7 +18,8 @@ import (
|
|||||||
"github.com/usual2970/certimate/internal/scheduler"
|
"github.com/usual2970/certimate/internal/scheduler"
|
||||||
"github.com/usual2970/certimate/internal/workflow"
|
"github.com/usual2970/certimate/internal/workflow"
|
||||||
"github.com/usual2970/certimate/ui"
|
"github.com/usual2970/certimate/ui"
|
||||||
//_ "github.com/usual2970/certimate/migrations"
|
|
||||||
|
_ "github.com/usual2970/certimate/migrations"
|
||||||
)
|
)
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
|
@ -12,16 +12,16 @@ func init() {
|
|||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
|
record, _ := app.FindAuthRecordByEmail(core.CollectionNameSuperusers, "admin@certimate.fun")
|
||||||
|
if record == nil {
|
||||||
record := core.NewRecord(superusers)
|
record := core.NewRecord(superusers)
|
||||||
record.Set("email", "admin@certimate.fun")
|
record.Set("email", "admin@certimate.fun")
|
||||||
record.Set("password", "1234567890")
|
record.Set("password", "1234567890")
|
||||||
return app.Save(record)
|
return app.Save(record)
|
||||||
}, func(app core.App) error {
|
|
||||||
record, _ := app.FindAuthRecordByEmail(core.CollectionNameSuperusers, "admin@certimate.fun")
|
|
||||||
if record == nil {
|
|
||||||
return nil
|
|
||||||
}
|
}
|
||||||
|
|
||||||
return app.Delete(record)
|
return nil
|
||||||
|
}, func(app core.App) error {
|
||||||
|
return nil
|
||||||
})
|
})
|
||||||
}
|
}
|
||||||
|
Loading…
x
Reference in New Issue
Block a user