Files
zsp-project/backend/pkg/database/migrate.go
2026-06-03 20:59:39 +08:00

40 lines
981 B
Go
Executable File

package database
import (
"github.com/rovina/zsp-backend/internal/model"
"gorm.io/gorm"
)
func AutoMigrate(db *gorm.DB) error {
return db.AutoMigrate(
&model.User{},
&model.Contract{},
&model.ContractFile{},
&model.ZSPContractFolder{},
&model.ZSPContractFile{},
&model.ZSPContractDetail{},
&model.ZSPFreightCharges{},
&model.ZSPMiscCharges{},
&model.ZSPServiceFees{},
&model.ZSPCostBreakdown{},
&model.ZSPProfitRecord{},
&model.ZSPUpstreamInvoice{},
&model.ZSPDownstreamInvoice{},
&model.ZSPFreightMiscInvoice{},
&model.ZSPSettlement{},
&model.ZSPReconciliation{},
&model.ContractFolder{},
&model.ContractBatch{},
&model.ContractBatchFile{},
&model.CompanyFolder{},
&model.CompanyFile{},
&model.DeliveryApply{},
&model.DeliveryOutbound{},
&model.Warehouse{},
&model.InventoryInbound{},
&model.OwnershipTransfer{},
&model.OwnershipTransferBL{},
&model.OwnershipTransferFile{},
)
}