Skip to content

Commit

Permalink
fix: build
Browse files Browse the repository at this point in the history
  • Loading branch information
devhaozi committed Jun 14, 2024
1 parent 5ddbdfc commit 27cbb92
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 25 deletions.
25 changes: 0 additions & 25 deletions app/models/migrate.go

This file was deleted.

19 changes: 19 additions & 0 deletions app/providers/database_service_provider.go
Original file line number Diff line number Diff line change
@@ -1,9 +1,13 @@
package providers

import (
"fmt"

"github.com/goravel/framework/contracts/database/seeder"
"github.com/goravel/framework/contracts/foundation"
"github.com/goravel/framework/facades"

"github.com/TheTNB/panel/app/models"
)

type DatabaseServiceProvider struct {
Expand All @@ -15,4 +19,19 @@ func (receiver *DatabaseServiceProvider) Register(app foundation.Application) {

func (receiver *DatabaseServiceProvider) Boot(app foundation.Application) {
facades.Seeder().Register([]seeder.Seeder{})
if err := facades.Orm().Query().AutoMigrate(
&models.Cert{},
&models.CertDNS{},
&models.CertUser{},
&models.Cron{},
&models.Database{},
&models.Monitor{},
&models.Plugin{},
&models.Setting{},
&models.Task{},
&models.User{},
&models.Website{},
); err != nil {
panic(fmt.Sprintf("Failed to migrate database: %v", err))
}
}

0 comments on commit 27cbb92

Please sign in to comment.