summaryrefslogtreecommitdiffstats
path: root/store/sql_audit_store.go
diff options
context:
space:
mode:
authorCorey Hulen <corey@hulen.com>2016-03-17 13:16:10 -0700
committerCorey Hulen <corey@hulen.com>2016-03-17 13:16:10 -0700
commit53d7718e57d4225eb5c020324d32cbe5b5eca7ad (patch)
tree9e549812c250513d56dd631c65c49402ea549ff7 /store/sql_audit_store.go
parent8d571ee498c97128bd797f8ac1cb4c3c995fb875 (diff)
parent2e5cc29738340c7330d1b2606ceba40865872e4c (diff)
downloadchat-53d7718e57d4225eb5c020324d32cbe5b5eca7ad.tar.gz
chat-53d7718e57d4225eb5c020324d32cbe5b5eca7ad.tar.bz2
chat-53d7718e57d4225eb5c020324d32cbe5b5eca7ad.zip
Merge pull request #2442 from mattermost/PLT-2115
PLT-2115 adding compliance feature
Diffstat (limited to 'store/sql_audit_store.go')
-rw-r--r--store/sql_audit_store.go15
1 files changed, 13 insertions, 2 deletions
diff --git a/store/sql_audit_store.go b/store/sql_audit_store.go
index dbcb9a616..7609ebc25 100644
--- a/store/sql_audit_store.go
+++ b/store/sql_audit_store.go
@@ -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() {