PLT-2115 Adding compliance
Этот коммит содержится в:
@@ -18,8 +18,8 @@ func NewSqlAuditStore(sqlStore *SqlStore) AuditStore {
|
||||
table := db.AddTableWithName(model.Audit{}, "Audits").SetKeys(false, "Id")
|
||||
table.ColMap("Id").SetMaxSize(26)
|
||||
table.ColMap("UserId").SetMaxSize(26)
|
||||
table.ColMap("Action").SetMaxSize(64)
|
||||
table.ColMap("ExtraInfo").SetMaxSize(128)
|
||||
table.ColMap("Action").SetMaxSize(512)
|
||||
table.ColMap("ExtraInfo").SetMaxSize(1024)
|
||||
table.ColMap("IpAddress").SetMaxSize(64)
|
||||
table.ColMap("SessionId").SetMaxSize(26)
|
||||
}
|
||||
@@ -28,6 +28,17 @@ func NewSqlAuditStore(sqlStore *SqlStore) AuditStore {
|
||||
}
|
||||
|
||||
func (s SqlAuditStore) UpgradeSchemaIfNeeded() {
|
||||
// ADDED for 2.2 REMOVE for 2.6
|
||||
extraLength := s.GetMaxLengthOfColumnIfExists("Audits", "ExtraInfo")
|
||||
if len(extraLength) > 0 && extraLength != "1024" {
|
||||
s.AlterColumnTypeIfExists("Audits", "ExtraInfo", "VARCHAR(1024)", "VARCHAR(1024)")
|
||||
}
|
||||
|
||||
// ADDED for 2.2 REMOVE for 2.6
|
||||
actionLength := s.GetMaxLengthOfColumnIfExists("Audits", "Action")
|
||||
if len(actionLength) > 0 && actionLength != "512" {
|
||||
s.AlterColumnTypeIfExists("Audits", "Action", "VARCHAR(512)", "VARCHAR(512)")
|
||||
}
|
||||
}
|
||||
|
||||
func (s SqlAuditStore) CreateIndexesIfNotExists() {
|
||||
|
||||
Ссылка в новой задаче
Block a user