summaryrefslogtreecommitdiffstats
path: root/store/sqlstore/channel_store.go
Commit message (Collapse)AuthorAgeFilesLines
* MM-12342: merge the experimental channel store (#9681)HEADmasterJesse Hallam2018-10-251-109/+281
| | | | | | * MM-12342: merge the experimental channel store * gofmt after upgrading to go 1.11
* MM-12419: Flush channels from cache when deleted/restored. (#9625)George Goldberg2018-10-151-0/+2
|
* [APIv4] add getChannelMembersTimezone (#9286)Carlos Tadeu Panato Junior2018-10-131-1/+22
| | | | | | | | * add getChannelMembersTimezone * update per feedback review * add delimeter to error
* MM-12251: Add flag to MoveChannel to remove all deactivated users. (#9515)George Goldberg2018-10-081-0/+26
|
* MM-11567: Autocomplete search in: for DMs and GMs (#9430)Jesús Espino2018-09-271-12/+59
| | | | | | | | | | * MM-11567: Autocomplete search in: for DMs and GMs * Adding unit tests * Allowing to search Direct Messages in the autocompletion * Fix it in TE
* materialize PublicChannels without triggers (#9424)Jesse Hallam2018-09-171-44/+203
| | | | Creating triggers requires SUPERUSER privileges, and is especially painful on RDS. Pivot to maintaining this denormalized table in code.
* MM-11781: Basic Data Export Command Line. (#9296)George Goldberg2018-09-171-0/+54
| | | | | | | | | | | | | | | | * MM-11781: Basic Data Export Command Line. * ChannelStore new unit tests. * TeamStore new unit tests. * Unit test for new UserStore function. * Unit tests for post store new methods. * Review fixes. * Fix duplicate command name.
* MM-11886: materialize channel search (#9349)Jesse Hallam2018-09-131-5/+33
| | | | | | | | | | | | | | | | | | | | | | | | * materialize PublicChannels table Introduce triggers for each supported database that automatically maintain a subset of the Channels table corresponding to only public channels. This improves corresponding queries that no longer need to filter out 99% DM channels. This initial commit modifies the channel store directly for easier code reviewing, but the next wraps an experimental version around it to enable a kill switch in case there are unforeseen performance regressions. This addresses [MM-11886](https://mattermost.atlassian.net/browse/MM-11886) and [MM-11945](https://mattermost.atlassian.net/browse/MM-11945). * extract the experimental public channels materialization Wrap the original channel store with an experimental version that leverages the materialized public channels, but can be disabled to fallback to the original implementation. This addresses MM-11947. * s/ExperimentalPublicChannelsMaterialization/EnablePublicChannelsMaterialization/ * simplify error handling * move experimental config listener until after store is initialized
* MM-11725: Add specific autocomplete endpoint for search autocomplete (#9337)Jesús Espino2018-09-111-0/+47
|
* Merge remote-tracking branch 'upstream/release-5.3' into ↵cpanato2018-09-041-0/+5
|\ | | | | | | release-5.3-daily-merge-20180904
| * MM-11728: Avoid Archived channels editions throught Patch (#9335)Jesús Espino2018-09-031-0/+5
| |
* | add megacheck as makefile target (#9288)Daniel Schalla2018-09-031-1/+1
|/ | | | | | | | | | | | | | | | | | | | | | | | | Fix code issues in channel_test.go Fix Channel Test Issues detected by Megacheck Fix API Emoji Test Issues detected by Megacheck Fixed API Issues Reported by Megacheck Fixed App issues reported by megacheck Remaining fixes removed test added by mistake from old HEAD gofmt Store Fixes simplified returns Fix test for multi member channel delete revert to delete unused function
* Fix sampledata reset LastPostAt when the channels are empty (#9295)Jesús Espino2018-08-241-1/+8
|
* MM-11572: Force correct order on messages generated in the bulk (#9244)Jesús Espino2018-08-241-0/+8
|
* MM-11678: Split the cache for includeDeleted and not includeDeleted ↵Jesús Espino2018-08-141-2/+7
| | | | | | | | memberships requests (#9254) * MM-11678: Split the cache for includeDeleted and not includeDeleted memberships requests * Updating properly the cache on sucess
* Pr 9039 (#9187)Martin Kraft2018-07-301-10/+38
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-11065: Allow to search and get archived channels from the API * Fixing more tests * Add some unit tests * Add includeDeleted parameter to session permissions check function * More test fixing * Adding archive channels list in channels search * Add restriction for archived channel edition * Reverting permissions checks modification * Changed the query parameter to include_deleted * Enable search archive channels as true by default * Adding tests for verify search on deleted channels * Allowing to override archive channels during the imports * Fixed test * Search in archive channels from the API must be explicitly requested * Removing includeDeleted parameter from GetChannelByName and GetChannelByNameForTeam * Back to ViewArchivedChannels config * Fixing tests * Reverting GetChannelByName parameter * Add include deleted parameter on GetChannel functions in plugins api * Fixing tests
* Using idiomatic error handling in channel store (#9130)Jesús Espino2018-07-201-247/+280
|
* Ignore | characters in postgres channel search (#9019)Joram Wilander2018-06-301-0/+2
|
* Add Purpose as a searchable field (#8067)Chris Duarte2018-06-261-3/+3
| | | | | | | | | | * Add Purpose as a searchable field * Add New Index and Remove old for Channels * Include Purpose in FullTextSearch Clause * Move removeIndex for Channels into upgrade.go
* MM-10570: Make permissions reset command clear custom role assignments. (#8976)George Goldberg2018-06-251-0/+69
|
* Relese5.0 merge master 20180611 (#8939)Carlos Tadeu Panato Junior2018-06-111-2/+6
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add missing diagnostics (#8911) * Update diagnostics.go * Update diagnostics.go * Fix push notification styling backwards compatibility (#8913) * MM-10803: remove premature user sanitization on deactivation (#8926) * remove unused UpdateNonSSOUserActive * MM-10803: stop prematurely sanitizing users on deactivate This change was preceded by the removal of UpdateNonSSOUserActive to ensure there are no APIs relying on the sanitized return value. * MM-10803: test websocket events after UpdateUserActive * MM-10264: Adds system scheme to permissions import/export. (#8924) * MM-10264: Adds system scheme to permissions import/export. * MM-10264: Switches to more likely unique name. * MM-10264: Changed collision prevention string. * MM-10264: Rolls back created schemes in all error cases. * MM-10264: Test fix for more rollback cases. * Fix idempotency of scheme migrations. (#8935) This fixes the issue where if the migration tries to migrate an already scheme-aware member object it would end up removing it's scheme-derived roles. Instead, only if the member object is unmigrated do we default to setting the scheme-derived role booleans to false. We tell if it is an unmigrated member object by checking if the booleans are set to null.
* MM-10235: Make permissions reset CLI shcemes-aware. (#8773)George Goldberg2018-05-171-0/+8
| | | | | | * MM-10235: Make permissions reset CLI shcemes-aware. * Add i18n strings.
* Fix build failure from bad merge.George Goldberg2018-05-161-4/+0
|
* Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-05-151-34/+3
|\
| * MM-9739: deprecate the now unused Channels.ExtraUpdateAt (#8762)Jesse Hallam2018-05-141-38/+3
| |
* | MM-9728: Online migration for advanced permissions phase 2 (#8744)George Goldberg2018-05-141-0/+68
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * MM-9728: Online migration for advanced permissions phase 2 * Add unit tests for new store functions. * Move migration specific code to own file. * Add migration state function test. * Style fixes. * Add i18n strings. * Fix mocks. * Add TestMain to migrations package tests. * Fix typo. * Fix review comments. * Fix up the "Check if migration is done" check to actually work.
* | MM-10140: API Implementation for Schemes related Endpoints (#8615)George Goldberg2018-05-031-1/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implement basic scheme CRUD endpoints. * Get All Schemes (Paged) Endpoint and store plumbing. * Add get teams/channels for schemes. * Fix unit tests. * Review fixes. * More review fixes.
* | Merge remote-tracking branch 'origin/master' into advanced-permissions-phase-2Martin Kraft2018-05-011-2/+2
|\|
| * Structured logging (#8673)Christopher Speller2018-04-271-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Implementing structured logging * Changes to en.json to allow refactor to run. * Fixing global logger * Structured logger initalization. * Add caller. * Do some log redirection. * Auto refactor * Cleaning up l4g reference and removing dependancy. * Removing junk. * Copyright headers. * Fixing tests * Revert "Changes to en.json to allow refactor to run." This reverts commit fd8249e99bcad0231e6ea65cd77c32aae9a54026. * Fixing some auto refactor strangeness and typo. * Making keys more human readable.
* | MM-8796: Full implementation of "Schemes" in Store/Model/App layers. (#8357)George Goldberg2018-04-201-51/+312
|/ | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * Add Scheme model and stub store. * Port ChannelStore to be Scheme aware. * Make almost all the API/APP layer work with ChannelSchemes. Only thing still hacky is UpdateChannelMemberRoles(). * Add basic SchemeStore implementation. * Migrate UpdateChannelMemberRoles properly and fix tests. * Update store tests and mocks so they work. * Include creating default roles in Scheme create store function. * Implement role deletion and start scheme deletion. * Only use non-deleted roles for authorization. * Add GetByScheme method to Team store. * Add GetChannelsByScheme. * Update store mocks. * Implement scheme deletion in the store. * Rename is valid function. * Add offset and limit to queries to fetch teams and channels by scheme. * Fix queries. * Implement scheme awareness in Team store and add a migration. * Tidy up ChannelStore mapping functions and add exhaustive unit tests. * Add all missing i18n. * Proper tests for TeamStore internal functions and fix them. * Make additional TeamMember fields nullable. * Make new ChannelMember fields nullable. * Create new nullable columns without defaults. * Make new fields in large tables nullalble. * Fix empty list of TeamMembers. * Deduplicate SQL queries. * Fix spelling. * Fix review comment. * More review fixes. * More review fixes.
* Fixing misspell errors (#8544)Jesús Espino2018-03-291-2/+2
|
* Remove the index on Channels.DisplayName. (#8530)Jesse Hallam2018-03-281-1/+0
| | | | | | | As outlined in [this discussion](https://pre-release.mattermost.com/core/pl/uw5bwmkb6irkbkn6pk9rkzpytr), this index causes issues with MySQL's query planner, leading to full table scans in a case where it would have made more sense to leverage a filesort.
* Remove query to update channel extra_update_at field on user ↵Joram Wilander2018-03-091-13/+0
| | | | activation/deactivation (#8415)
* MM-9664 Add invalidation metrics for store caches (#8340)Joram Wilander2018-03-051-12/+35
| | | | | | | | * Add invalidation metrics for store caches * Increment session invalidation metric * Fix tests
* Simplification of a Channel Members query. (#8345)George Goldberg2018-02-281-3/+3
|
* make channel autocomplete sort case-insensitive (#8176)Chris2018-01-311-1/+1
|
* ABC-79: Optimize channel autocomplete query (#8163)Chris2018-01-311-47/+105
| | | | | | * optimize channel autocomplete query * move to new autocomplete endpoint
* PLT-8312: Use combined LIKE/Full Text search for channels. (#8029)George Goldberg2018-01-051-7/+57
| | | | | | | | | | * PLT-8312: Use combined LIKE/Full Text search for channels. * Code tidyup * Get it working consistently and update unit tests. * Fix code style.
* PLT-5458: If someone posts a channel link to channel_A that you don't belong ↵Chris2017-11-281-0/+59
| | | | | | | | | | | | to, it doesn't render properly (#7833) * add channel link hints to post props * optimization * update regex, add unit test * fix rebase issue
* Role refactor (#7867)Chris2017-11-211-2/+2
| | | | | | | | * role refactor * add missing file * fix web test
* PLT-6071/PLT-8004 Fixed not being able to autocomplete 'Town Square' (#7746)Harrison Healey2017-10-311-1/+1
|
* Remove unused variables / code (#7736)Chris2017-10-301-5/+0
| | | | | | * remove unused variables / code * fix bug in testPostStoreGetOldest
* [PLT-7364] Ability to Direct Message yourself (#7696)Carlos Tadeu Panato Junior2017-10-261-1/+4
| | | | | | * [PLT-7364] Ability to Direct Message yourself * [PLT-7364] add tests
* refactor max channels per team enforcement (#7690)Chris2017-10-201-6/+6
|
* [PLT-7764] Fix in:channel search when channel name/displayname includes `-` ↵Saturnino Abril2017-10-111-28/+15
| | | | | | | | | | (#7603) * fix in:channel search when channel name/displayname includes `-` * fix failing test in PostgreSQL * add lowercase indexes of channel's name and displayname to postgresql, and add unit tests
* store/sqlstore cleanup and postgres tests (#7595)Chris2017-10-091-4/+4
| | | | | | | | | | * sqlstore cleanup / postgres tests * remove stopped containers * cmd/platform compile fix * remove test-postgres target from makefile
* reduce store boiler plate (#7585)Chris2017-10-061-462/+87
|
* PLT-7404 Return viewed at times in view channel API response (#7428)Joram Wilander2017-09-291-25/+55
| | | | | | | | * Return viewed at times in view channel API response * Updated transaction to read and write once * Remove transaction and only update if new value greater than older
* PLT-7207: Change from fulltext to LIKE search for user filtering (#7343)George Goldberg2017-09-271-1/+1
| | | | | | | | | | | | * PLT-7202: Switch user search to LIKE queries to avoid fulltext pitfalls. * Add 2 char name unit test. * Escape underscores properly. * Add more tests and fix * handling. * Make search/indexes case insensitive for postgres.
* Move sql store code into store/sqlstore package (#7502)Chris2017-09-251-0/+1664
* move sql store code into store/sqlstore package * move non-sql constants back up to store * fix api test * derp