Restore initial admin password when running photoprism reset

Signed-off-by: Michael Mayer <michael@liquidbytes.net>
This commit is contained in:
Michael Mayer 2020-08-19 15:36:31 +02:00
parent b3bb2883fc
commit b476916936

View file

@ -51,9 +51,14 @@ func resetAction(ctx *cli.Context) error {
log.Infoln("dropping existing tables")
tables.Drop()
log.Infoln("creating new tables")
tables.Migrate()
tables.WaitForMigration()
log.Infoln("restoring default schema")
entity.MigrateDb()
if conf.AdminPassword() != "" {
log.Infoln("restoring initial admin password")
entity.Admin.InitPassword(conf.AdminPassword())
}
log.Infof("database reset completed in %s", time.Since(start))