change paths, add task to db

This commit is contained in:
Florian Hoss 2022-04-04 12:13:55 +02:00
parent 6a56b03bf6
commit 9e058e4f03
7 changed files with 87 additions and 70 deletions

View file

@ -13,6 +13,10 @@ func migrateInitial(orm *gorm.DB) {
if err != nil {
fmt.Println(fmt.Errorf("failed to migrate User"))
}
err = orm.AutoMigrate(&Task{})
if err != nil {
fmt.Println(fmt.Errorf("failed to migrate Task"))
}
}
func (db *Database) Initialize() {

View file

@ -14,3 +14,9 @@ type User struct {
Password string
LoggedIn bool
}
type Task struct {
ID int `gorm:"primaryKey"`
Description string
Done bool
}