* Refactor schema table migration mechanism
The old schema table migration code was initializing the migration
engine before changing the migrations table and was mixing queries on
two different database connections (the `s.db` connection and the
migrations `db` connection).
The changes on this commit take care of changing the migrations table
before the morph migration engine is initialized and they use the same
connection for all operations, better isolating the schema table
migration process.
* Update migrate function to take the cluster mutex first thing
* Split migration code and orchestration on different functions
* Wrap custom errors on data migrations
* Rename private migration method
* Update server/services/store/sqlstore/migrate.go
Co-authored-by: Doug Lauder <wiggin77@warpmail.net>
* Added tab;le creation migration
* WIP
* Finished base impl
* Added MySQL migration
* WIP
* Added personal server store methods
* WIP
* Fixed webapp tests
* Updated server tests
* generated code
* generated code
* generated code
* used raw queries instead of plugin methods to avoid updating productapi package
* Added API doc
* Added sqlite migratins
* used plugin APIs again s=instead of raw queries
* WIP
* Added missed case of SQL migration where personal server can run on Postgres and MySQL
* CI
* Removed unsupported POSL operator
* Low on caffine. Making silly mistakes
* json handling
* int test
* hope tests pass
* Fix incorrect column size
* Webapp lint fixes
* remived debug code
* Updated moigration version
* Review fixes
* Adds a check that errors on store start if MariaDB is detected
* Fix linter
* Update error message
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
* Adds data migration to clean badly assigned boards
This data migration fetches all boards whose owner has a deleted
membership on the board's team and fixes them by processing them
again, this time with the fix applied to the `getBestTeamForBoard`
function that skips deleted teams and team memberships
* Do not create a transaction if there are no offending boards found
* Fix linter
* Converted synthetic membership to natuaral if needed
* Creating duplicated board to same category as parent board
* fixed tests
* fixed an incorrect API path in client
* Added logic to prevent jumping of new board between categories
* fixed lint error
* Update teamless boards migration to check for deleted entities
After this changes, the `TeamLessBoardsMigration` will check the team
and the team membership of the users to discard deleted entities when
cosidering what team to assign a board to
* Fix linter
* Uncomment team insights test
* Add checks to make sure insights endpoints work only in plugin mode
* adding constant for my insights
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
* Add boilerplate functions and handlers for boards insights
* Fix function signatures to add 'duration' parameter, fix where clauses in db queries
* Fix where clause to include boards of which userId in parameter is a member
* Modify queries to work with sqlite, postgres, mysql
* Integration tests, and results of make generate
* Lint Fixes
* Add icons to board insights
* Lint fixes
* Format insights queries without squirrel to fix parameterization issues
* Add tests for sqlstore utility functions
* Improve team insights tests by creating 2 boards
* Refactor endpoints/app to adhere to developments in 7.0 release
* Refactor queries to use squirrel
* Lint fixes
* Fix client, integration tests
* Remove old integration tests
* Add storetests, refactor functions to handle authorized board_ids
* Make queries compatible with mysql, sqlite
* Add app tests
* Fix lint errors
* Revert makefile changes, fix docstring in api
* Lint fixes and doc correction suggested by @wiggin77
* Fix mock store call count error
* adding client code
* Make the following changes
- use serviceAPI to get user.Timezone
- rename licenseAndGuestUserCheck to insightPermissionGate, and handle returned error better
- validate page, perPage parameters aren't < 0
* Lint fix
Co-authored-by: Mattermod <mattermod@users.noreply.github.com>
Co-authored-by: Benjamin Cooke <benjamincooke@Benjamins-MacBook-Pro.local>
* fix panic caused by returning nil,nil in GetMemberForBoard
* lint fix
* lint fix- need updated variable name
Co-authored-by: Scott Bishel <scott.bishel@mattermost.com>