Initial commit including .env

This commit is contained in:
2026-06-22 17:43:40 +05:30
commit c577d47b75
286 changed files with 85878 additions and 0 deletions

52
migrations/migrate.go Normal file
View File

@@ -0,0 +1,52 @@
package migrations
import (
"doormile/models"
"doormile/utils"
"gorm.io/gorm"
)
func Migrate(db *gorm.DB) error {
utils.Info("Starting database auto-migrations for 21 logistics tables...")
err := db.AutoMigrate(
&models.PartnerInfo{},
&models.Hub{},
&models.Vehicle{},
&models.AppUser{},
&models.MilerProfile{},
&models.AppCustomer{},
&models.AppCustomerLocation{},
&models.Consignment{},
&models.PickupBooking{},
&models.BookingParcel{},
&models.BookingServiceOption{},
&models.BookingPayment{},
&models.BookingAssignment{},
&models.BookingVehicleRequirement{},
&models.Tripsheet{},
&models.TripsheetItem{},
&models.DeliveryProof{},
&models.Pricing{},
&models.ConsignmentHistory{},
&models.ConsignmentException{},
&models.TenantLocation{},
&models.AppLocation{},
&models.Tenant{},
&models.Customer{},
&models.CustomerLocation{},
&models.DoormileClient{},
&models.DoormileAuth{},
&models.CompetitorBranch{},
&models.CarrierPricing{},
&models.DoormilePricing{},
)
if err != nil {
utils.Error("❌ Database migration failed", "error", err)
return err
}
utils.Info("✅ Database migration completed successfully!")
return nil
}