Aditya Siregar a759e0f57c init
2025-07-30 23:18:20 +07:00

28 lines
482 B
Go

package entities
import "gorm.io/gorm"
func GetAllEntities() []interface{} {
return []interface{}{
&Organization{},
&Outlet{},
&OutletSetting{},
&User{},
&Category{},
&Product{},
&ProductVariant{},
&Inventory{},
&Order{},
&OrderItem{},
&PaymentMethod{},
&Payment{},
&Customer{},
&Table{},
// Analytics entities are not database tables, they are query results
}
}
func AutoMigrate(db *gorm.DB) error {
return db.AutoMigrate(GetAllEntities()...)
}