refact(session connection): remove session connection state table (#4617)
* refact(session connection): remove session connection state table
This commit is contained in:
1 parent
eb6e1b558d
commit
2191aa1d03
27 files changed
+543
-729
No files matched your search
@@ -13,7 +13,7 @@ import (
|
||||
)
|
||||
|
||||
const (
|
||||
defaultConnectionTableName = "session_connection"
|
||||
defaultConnectionTableName = "session_connection_with_status_view" // "session_connection"
|
||||
)
|
||||
|
||||
// Connection contains information about session's connection to a target
|
||||
@@ -44,6 +44,8 @@ type Connection struct {
|
||||
UpdateTime *timestamp.Timestamp `json:"update_time,omitempty" gorm:"default:current_timestamp"`
|
||||
// Version of the connection
|
||||
Version uint32 `json:"version,omitempty" gorm:"default:null"`
|
||||
// Status is a field derived from connected_time_range
|
||||
Status string `json:"status,omitempty" gorm:"default:null"`
|
||||
|
||||
tableName string `gorm:"-"`
|
||||
}
|
||||
@@ -94,6 +96,7 @@ func (c *Connection) Clone() any {
|
||||
BytesDown: c.BytesDown,
|
||||
ClosedReason: c.ClosedReason,
|
||||
Version: c.Version,
|
||||
Status: c.Status,
|
||||
}
|
||||
if c.CreateTime != nil {
|
||||
clone.CreateTime = ×tamp.Timestamp{
|
||||
|
||||
Reference in new issue
Block a user