25 lines
1007 B
Go
25 lines
1007 B
Go
package model
|
|
|
|
import (
|
|
"next-terminal/server/common"
|
|
)
|
|
|
|
type DatabaseSQLLog struct {
|
|
ID string `gorm:"primary_key,type:varchar(36)" json:"id"`
|
|
AssetId string `gorm:"index,type:varchar(36)" json:"assetId"`
|
|
Database string `gorm:"type:varchar(200)" json:"database"`
|
|
UserId string `gorm:"index,type:varchar(36)" json:"userId"`
|
|
ClientIP string `gorm:"type:varchar(50);index" json:"clientIp"`
|
|
SQL string `gorm:"type:text" json:"sql"`
|
|
DurationMs int `json:"durationMs"`
|
|
RowsAffected int `json:"rowsAffected"`
|
|
Status string `gorm:"type:varchar(20);index" json:"status"`
|
|
ErrorMessage string `gorm:"type:text" json:"errorMessage"`
|
|
Source string `gorm:"type:varchar(50);index" json:"source"`
|
|
Created common.JsonTime `gorm:"type:datetime;index" json:"createdAt"`
|
|
}
|
|
|
|
func (r *DatabaseSQLLog) TableName() string {
|
|
return "database_sql_logs"
|
|
}
|