44 lines
787 B
Go
Raw Normal View History

2025-07-18 20:10:29 +07:00
package entities
import "gorm.io/gorm"
func GetAllEntities() []interface{} {
return []interface{}{
&Organization{},
&Outlet{},
&OutletSetting{},
&User{},
&Category{},
&Product{},
&ProductVariant{},
&Inventory{},
&Order{},
&OrderItem{},
&PaymentMethod{},
&Payment{},
&Customer{},
2025-07-30 23:18:20 +07:00
&Table{},
2025-09-12 01:12:11 +07:00
&Vendor{},
&PurchaseOrder{},
&PurchaseOrderItem{},
&PurchaseOrderAttachment{},
&IngredientUnitConverter{},
2025-09-17 19:30:17 +07:00
// Gamification entities
&CustomerPoints{},
&CustomerTokens{},
&Tier{},
&Game{},
&GamePrize{},
&GamePlay{},
&OmsetTracker{},
2025-09-17 23:55:11 +07:00
&Reward{},
&Campaign{},
&CampaignRule{},
2025-07-18 20:10:29 +07:00
// Analytics entities are not database tables, they are query results
}
}
func AutoMigrate(db *gorm.DB) error {
return db.AutoMigrate(GetAllEntities()...)
}