Bump max allowed file uploads per post (#17948)

Этот коммит содержится в:
Claudio Costa
2021-08-18 15:50:17 +02:00
коммит произвёл GitHub
родитель 0dbaa48741
Коммит 536895a9ba
3 изменённых файлов: 5 добавлений и 2 удалений

Просмотреть файл

@@ -8588,7 +8588,7 @@
}, },
{ {
"id": "model.post.is_valid.file_ids.app_error", "id": "model.post.is_valid.file_ids.app_error",
"translation": "Invalid file ids. Note that uploads are limited to 5 files maximum. Please use additional posts for more files." "translation": "Invalid file ids. Note that uploads are limited to 10 files maximum. Please use additional posts for more files."
}, },
{ {
"id": "model.post.is_valid.filenames.app_error", "id": "model.post.is_valid.filenames.app_error",

Просмотреть файл

@@ -145,7 +145,7 @@ func newSqlPostStore(sqlStore *SqlStore, metrics einterfaces.MetricsInterface) s
table.ColMap("Hashtags").SetMaxSize(1000) table.ColMap("Hashtags").SetMaxSize(1000)
table.ColMap("Props").SetDataType(sqlStore.jsonDataType()) table.ColMap("Props").SetDataType(sqlStore.jsonDataType())
table.ColMap("Filenames").SetMaxSize(model.PostFilenamesMaxRunes) table.ColMap("Filenames").SetMaxSize(model.PostFilenamesMaxRunes)
table.ColMap("FileIds").SetMaxSize(300) table.ColMap("FileIds").SetMaxSize(model.PostFileidsMaxRunes)
table.ColMap("RemoteId").SetMaxSize(26) table.ColMap("RemoteId").SetMaxSize(26)
} }

Просмотреть файл

@@ -1316,6 +1316,9 @@ func upgradeDatabaseToVersion600(sqlStore *SqlStore) {
sqlStore.GetMaster().ExecNoTimeout("UPDATE CommandWebhooks SET RootId = ParentId WHERE RootId = '' AND RootId != ParentId") sqlStore.GetMaster().ExecNoTimeout("UPDATE CommandWebhooks SET RootId = ParentId WHERE RootId = '' AND RootId != ParentId")
sqlStore.RemoveColumnIfExists("CommandWebhooks", "ParentId") sqlStore.RemoveColumnIfExists("CommandWebhooks", "ParentId")
// allow 10 files per post
sqlStore.AlterColumnTypeIfExists("Posts", "FileIds", "text", "varchar(300)")
// saveSchemaVersion(sqlStore, Version600) // saveSchemaVersion(sqlStore, Version600)
// } // }
} }