mirror of
https://github.com/NginxProxyManager/nginx-proxy-manager.git
synced 2025-08-03 07:53:39 +00:00
Convert db backend to use Gorm, with basis for support
for Mysql and Postgres in addition to existing Sqlite
This commit is contained in:
13
backend/internal/entity/model_base.go
Normal file
13
backend/internal/entity/model_base.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package entity
|
||||
|
||||
import (
|
||||
"gorm.io/plugin/soft_delete"
|
||||
)
|
||||
|
||||
// ModelBase include common fields for db control
|
||||
type ModelBase struct {
|
||||
ID uint `json:"id" gorm:"column:id;primaryKey"`
|
||||
CreatedAt int64 `json:"created_at" gorm:"<-:create;autoCreateTime:milli;column:created_at"`
|
||||
UpdatedAt int64 `json:"updated_at" gorm:"<-;autoUpdateTime:milli;column:updated_at"`
|
||||
DeletedAt soft_delete.DeletedAt `json:"-" gorm:"column:is_deleted;softDelete:flag"`
|
||||
}
|
Reference in New Issue
Block a user