* MM-16888: fix missing indexes
As part of https://mattermost.atlassian.net/browse/MM-16888, we discovered and fixed a number of column and index mismatches between the canonical (i.e. created from scratch) and migrated schemas (i.e migrated from 5.0 through 5.16).
Unfortunately, the migration to fix same was added to `UpgradeDatabaseToVersion514` but never cherry picked to the pending v5.14 release at the time. Customers who upgraded to v5.14 or v5.15 and then get this code as part of v5.16 will never run that migration. Copy it to the UpgradeDatabaseToVersion516 accordingly.
* avoid fixing ChannelMembers.SchemeGuest on MySQL
* synchronize .circleci/config.yml with scripts/mysql-migration-test.sh
* fix circleci invocation
* additional logging on diff
* update build/Jenkinsfile.pr too!
* Add different types for different mentions
* Remove redundant THREAD_ANY and THREAD_ROOT constants
* Make PostStore.Get return thread in order
* MM-17071 Add initial version of countMentionsFromPost
* MM-17071 Refactor comment mention counting
* MM-17071 Use mention counting when marking post as unread
* Fix shadowing in tests
* Remove repeated check of user count
* Refactor code using MentionType
* Update comments around -1 return value
* Move inner functions out of countMentionsFromPost
* Remove preconditions check as separate test case
* Update comments
* Add User.GetMentionKeys
* Revert "Make PostStore.Get return thread in order"
This reverts commit 22aa010cee.
* Fix tests
* Fix merge conflict
* Add store.MentionAllPosts
* Migrating roles and schemes to new Cache Layer
* Adding missed license headers
* Updating cache tests
* Adding the cache layer to the testlib helper
* Fixing cyclic dependency
* fixing a bit of not-idiomatic error handling
* Another small fix arrount idiomatic error handling
* Add methods to handle include_total_count api parameter when permissions
for authenticated user is not sysadmin
* Add translations for app errors
* Add Mocks
* Add tests for new methods
* When running at the TeamStore testing level, the number of returned
teams is different than running tests individually. Fix for now and
submit help wanted do proper teardown after each test
* correct value when running test at the top level
* Add helper function to delete previous teams in db
* Instead of checking against numbers of teams returned, check against the
actual teams returned.
When creating test teams, use unique DisplaName values so the return
array will be sorted consistantly.
When testing private and public team counts, add teams that should not
be counted. Also create odd number of public/private teams for better
error protections. Don't want 1 of each type
* Add integrity command
* Add structures and implementation for basic referential integrity check
* Use a channel to receive integrity check reports as they generates
* Setup unit testing
* Add confirm prompt to integrity command and make verbose output optional
* Add more integrity checks
* Use wrapper functions to simplify behaviour and tests
* Improve extensibility of IntegrityCheckResult
* Improve CheckIntegrity tests performance
* Use a config structure for relational integrity checks
* Add more relational integrity checks
* Add more checks and do some cleanup
* Add more relational integrity checks with proper tests
* Fix tests to use sync functions
* Add more info to integrity command help
* Add more relational integrity checks
* Add more relational integrity checks
* Add missing checks
* Show more information about missing records
* Fix to use new sync function
* Change integrity check functions to accept a SqlSupplier
* Fix code duplication
* Use squirrel for query building
* Implement KVCompareAndDelete and KVCompareAndDeleteJSON
* Add tests for KVCompareAndDelete
* Update minimum server version
* Handle nil value on CompareAndSet so that it deletes it
* Fix comments
* Tweaks from PR comments
* Go back to deleted, err