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