jiangshuai
2023-11-14 22a93375823a1fe58e5ca2dcd0545ddf1dfc883c
models/db.go
@@ -73,7 +73,21 @@
func RegisterTables() error {
   db := mysqlx.GetDB()
   err := db.AutoMigrate(
      Company{},
      Warehouse{},
      OperationType{},
      Location{},
      OperationType{},
      Operation{},
      OperationDetails{},
      Scrap{},
      ProductCategory{},
      Material{},
      LocationProduct{},
      LocationProductAmount{},
      ReorderRule{},
      Attachment{},
      LogisticCompany{},
   )
   return err
}
@@ -85,6 +99,7 @@
func InsertDefaultData() {
   models := []interface{}{
      NewDepartmentSearch(),
      NewLocationSearch(),
   }
   for _, model := range models {
      if id, ok := model.(InitDefaultData); ok {