init
This commit is contained in:
@@ -0,0 +1,26 @@
|
||||
package entities
|
||||
|
||||
import "gorm.io/gorm"
|
||||
|
||||
func GetAllEntities() []interface{} {
|
||||
return []interface{}{
|
||||
&Organization{},
|
||||
&Outlet{},
|
||||
&OutletSetting{},
|
||||
&User{},
|
||||
&Category{},
|
||||
&Product{},
|
||||
&ProductVariant{},
|
||||
&Inventory{},
|
||||
&Order{},
|
||||
&OrderItem{},
|
||||
&PaymentMethod{},
|
||||
&Payment{},
|
||||
&Customer{},
|
||||
// Analytics entities are not database tables, they are query results
|
||||
}
|
||||
}
|
||||
|
||||
func AutoMigrate(db *gorm.DB) error {
|
||||
return db.AutoMigrate(GetAllEntities()...)
|
||||
}
|
||||
Reference in New Issue
Block a user