added frontend and updated backend with docker, wrote some initial instructions

This commit is contained in:
Elmar Kresse
2023-09-19 21:34:29 +02:00
parent b8a638a5fe
commit c051995823
87 changed files with 4987 additions and 1574 deletions

View File

@@ -0,0 +1,34 @@
package migrations
import (
"github.com/pocketbase/dbx"
"github.com/pocketbase/pocketbase/daos"
m "github.com/pocketbase/pocketbase/migrations"
"github.com/pocketbase/pocketbase/models"
)
func init() {
m.Register(func(db dbx.Builder) error {
dao := daos.New(db)
admin := &models.Admin{}
admin.Email = "demo@htwkalender.de"
err := admin.SetPassword("htwkalender-demo")
if err != nil {
return err
}
return dao.SaveAdmin(admin)
}, func(db dbx.Builder) error { // optional revert operation
dao := daos.New(db)
admin, _ := dao.FindAdminByEmail("test@example.com")
if admin != nil {
return dao.DeleteAdmin(admin)
}
// already deleted
return nil
})
}