Template
remove sub things and add view
This commit is contained in:
1 parent
feb248e991
commit
2b13e5c03a
5 files changed
+3
-85
No files matched your search
+3
-10
@@ -10,15 +10,8 @@ import (
|
||||
)
|
||||
|
||||
type Thing struct {
|
||||
ID int
|
||||
Name string
|
||||
Subthings []SubThing
|
||||
}
|
||||
|
||||
type SubThing struct {
|
||||
ID int
|
||||
ThingID int
|
||||
Name string
|
||||
ID int
|
||||
Name string
|
||||
}
|
||||
|
||||
func InitDB() *gorm.DB {
|
||||
@@ -30,6 +23,6 @@ func InitDB() *gorm.DB {
|
||||
if err != nil {
|
||||
log.Panic(err)
|
||||
}
|
||||
db.AutoMigrate(&Thing{}, &SubThing{})
|
||||
db.AutoMigrate(&Thing{})
|
||||
return db
|
||||
}
|
||||
Reference in new issue
Block a user