mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-03 20:40:00 -05:00
* Remove legacy quoteColumnName() utility Since Mattermost only supports PostgreSQL, the quoteColumnName() helper that was designed to handle database-specific column quoting is no longer needed. The function was a no-op that simply returned the column name unchanged. Remove the function from utils.go and update status_store.go to use the "Manual" column name directly. * Remove legacy driver checks from store.go Since Mattermost only supports PostgreSQL, remove conditional checks for different database drivers: - Simplify specialSearchChars() to always return PostgreSQL-compatible chars - Remove driver check from computeBinaryParam() - Remove driver check from computeDefaultTextSearchConfig() - Simplify GetDbVersion() to use PostgreSQL syntax directly - Remove switch statement from ensureMinimumDBVersion() - Remove unused driver parameter from versionString() * Remove MySQL alternatives for batch delete operations Since Mattermost only supports PostgreSQL, remove the MySQL-specific DELETE...LIMIT syntax and keep only the PostgreSQL array-based approach: - reaction_store.go: Use PostgreSQL array syntax for PermanentDeleteBatch - file_info_store.go: Use PostgreSQL array syntax for PermanentDeleteBatch - preference_store.go: Use PostgreSQL tuple IN subquery for DeleteInvalidVisibleDmsGms * Remove MySQL alternatives for UPDATE...FROM syntax Since Mattermost only supports PostgreSQL, remove the MySQL-specific UPDATE syntax that joins tables differently: - thread_store.go: Use PostgreSQL UPDATE...FROM syntax in MarkAllAsReadByChannels and MarkAllAsReadByTeam - post_store.go: Use PostgreSQL UPDATE...FROM syntax in deleteThreadFiles * Remove MySQL alternatives for JSON and subquery operations Since Mattermost only supports PostgreSQL, remove the MySQL-specific JSON and subquery syntax: - thread_store.go: Use PostgreSQL JSONB operators for updating participants - access_control_policy_store.go: Use PostgreSQL JSONB @> operator for querying JSON imports - session_store.go: Use PostgreSQL subquery syntax for Cleanup - job_store.go: Use PostgreSQL subquery syntax for Cleanup * Remove MySQL alternatives for CTE queries Since Mattermost only supports PostgreSQL, simplify code that uses CTEs (Common Table Expressions): - channel_store.go: Remove MySQL CASE-based fallback in UpdateLastViewedAt and use PostgreSQL CTE exclusively - draft_store.go: Remove driver checks in DeleteEmptyDraftsByCreateAtAndUserId, DeleteOrphanDraftsByCreateAtAndUserId, and determineMaxDraftSize * Remove driver checks in migrate.go and schema_dump.go Simplify migration code to use PostgreSQL driver directly since PostgreSQL is the only supported database. * Remove driver checks in sqlx_wrapper.go Always apply lowercase named parameter transformation since PostgreSQL is the only supported database. * Remove driver checks in user_store.go Simplify user store functions to use PostgreSQL-only code paths: - Remove isPostgreSQL parameter from helper functions - Use LEFT JOIN pattern instead of subqueries for bot filtering - Always use case-insensitive LIKE with lower() for search - Remove MySQL-specific role filtering alternatives * Remove driver checks in post_store.go Simplify post_store.go to use PostgreSQL-only code paths: - Inline getParentsPostsPostgreSQL into getParentsPosts - Use PostgreSQL TO_CHAR/TO_TIMESTAMP for date formatting in analytics - Use PostgreSQL array syntax for batch deletes - Simplify determineMaxPostSize to always use information_schema - Use PostgreSQL jsonb subtraction for thread participants - Always execute RefreshPostStats (PostgreSQL materialized views) - Use materialized views for AnalyticsPostCountsByDay - Simplify AnalyticsPostCountByTeam to always use countByTeam * Remove driver checks in channel_store.go Simplify channel_store.go to use PostgreSQL-only code paths: - Always use sq.Dollar.ReplacePlaceholders for UNION queries - Use PostgreSQL LEFT JOIN for retention policy exclusion - Use PostgreSQL jsonb @> operator for access control policy imports - Simplify buildLIKEClause to always use LOWER() for case-insensitive search - Simplify buildFulltextClauseX to always use PostgreSQL to_tsvector/to_tsquery - Simplify searchGroupChannelsQuery to use ARRAY_TO_STRING/ARRAY_AGG * Remove driver checks in file_info_store.go Simplify file_info_store.go to use PostgreSQL-only code paths: - Always use PostgreSQL to_tsvector/to_tsquery for file search - Use file_stats materialized view for CountAll() - Use file_stats materialized view for GetStorageUsage() when not including deleted - Always execute RefreshFileStats() for materialized view refresh * Remove driver checks in attributes_store.go Simplify attributes_store.go to use PostgreSQL-only code paths: - Always execute RefreshAttributes() for materialized view refresh - Remove isPostgreSQL parameter from generateSearchQueryForExpression - Always use PostgreSQL LOWER() LIKE LOWER() syntax for case-insensitive search * Remove driver checks in retention_policy_store.go Simplify retention_policy_store.go to use PostgreSQL-only code paths: - Remove isPostgres parameter from scanRetentionIdsForDeletion - Always use pq.Array for scanning retention IDs - Always use pq.Array for inserting retention IDs - Remove unused json import * Remove driver checks in property stores Simplify property_field_store.go and property_value_store.go to use PostgreSQL-only code paths: - Always use PostgreSQL type casts (::text, ::jsonb, ::bigint, etc.) - Remove isPostgres variable and conditionals * Remove driver checks in channel_member_history_store.go Simplify PermanentDeleteBatch to use PostgreSQL-only code path: - Always use ctid-based subquery for DELETE with LIMIT * Remove remaining driver checks in user_store.go Simplify user_store.go to use PostgreSQL-only code paths: - Use LEFT JOIN for bot exclusion in AnalyticsActiveCountForPeriod - Use LEFT JOIN for bot exclusion in IsEmpty * Simplify fulltext search by consolidating buildFulltextClause functions Remove convertMySQLFullTextColumnsToPostgres and consolidate buildFulltextClause and buildFulltextClauseX into a single function that takes variadic column arguments and returns sq.Sqlizer. * Simplify SQL stores leveraging PostgreSQL-only support - Simplify UpdateMembersRole in channel_store.go and team_store.go to use UPDATE...RETURNING instead of SELECT + UPDATE - Simplify GetPostReminders in post_store.go to use DELETE...RETURNING - Simplify DeleteOrphanedRows queries by removing MySQL workarounds for subquery locking issues - Simplify UpdateUserLastSyncAt to use UPDATE...FROM...RETURNING instead of fetching user first then updating - Remove MySQL index hint workarounds in ORDER BY clauses - Update outdated comments referencing MySQL - Consolidate buildFulltextClause and remove convertMySQLFullTextColumnsToPostgres * Remove MySQL-specific test artifacts - Delete unused MySQLStopWords variable and stop_word.go file - Remove redundant testSearchEmailAddressesWithQuotes test (already covered by testSearchEmailAddresses) - Update comment that referenced MySQL query planning * Remove MySQL references from server code outside sqlstore - Update config example and DSN parsing docs to reflect PostgreSQL-only support - Remove mysql:// scheme check from IsDatabaseDSN - Simplify SanitizeDataSource to only handle PostgreSQL - Remove outdated MySQL comments from model and plugin code * Remove MySQL references from test files - Update test DSNs to use PostgreSQL format - Remove dead mysql-replica flag and replicaFlag variable - Simplify tests that had MySQL/PostgreSQL branches * Update docs and test config to use PostgreSQL - Update mmctl config set example to use postgres driver - Update test-config.json to use PostgreSQL DSN format * Remove MySQL migration scripts, test data, and docker image Delete MySQL-related files that are no longer needed: - ESR upgrade scripts (esr.*.mysql.*.sql) - MySQL schema dumps (mattermost-mysql-*.sql) - MySQL replication test scripts (replica-*.sh, mysql-migration-test.sh) - MySQL test warmup data (mysql_migration_warmup.sql) - MySQL docker image reference from mirror-docker-images.json * Remove MySQL references from webapp - Simplify minimumHashtagLength description to remove MySQL-specific configuration note - Remove unused HIDE_MYSQL_STATS_NOTIFICATION preference constant - Update en.json i18n source file * clean up e2e-tests * rm server/tests/template.load * Use teamMemberSliceColumns() in UpdateMembersRole RETURNING clause Refactor to use the existing helper function instead of hardcoding the column names, ensuring consistency if the columns are updated. * u.id -> u.Id * address code review feedback --------- Co-authored-by: Mattermost Build <build@mattermost.com> |
||
|---|---|---|
| .. | ||
| mmctl.rst | ||
| mmctl_auth.rst | ||
| mmctl_auth_clean.rst | ||
| mmctl_auth_current.rst | ||
| mmctl_auth_delete.rst | ||
| mmctl_auth_list.rst | ||
| mmctl_auth_login.rst | ||
| mmctl_auth_renew.rst | ||
| mmctl_auth_set.rst | ||
| mmctl_bot.rst | ||
| mmctl_bot_assign.rst | ||
| mmctl_bot_create.rst | ||
| mmctl_bot_disable.rst | ||
| mmctl_bot_enable.rst | ||
| mmctl_bot_list.rst | ||
| mmctl_bot_update.rst | ||
| mmctl_channel.rst | ||
| mmctl_channel_archive.rst | ||
| mmctl_channel_create.rst | ||
| mmctl_channel_delete.rst | ||
| mmctl_channel_list.rst | ||
| mmctl_channel_modify.rst | ||
| mmctl_channel_move.rst | ||
| mmctl_channel_rename.rst | ||
| mmctl_channel_search.rst | ||
| mmctl_channel_unarchive.rst | ||
| mmctl_channel_users.rst | ||
| mmctl_channel_users_add.rst | ||
| mmctl_channel_users_remove.rst | ||
| mmctl_command.rst | ||
| mmctl_command_archive.rst | ||
| mmctl_command_create.rst | ||
| mmctl_command_list.rst | ||
| mmctl_command_modify.rst | ||
| mmctl_command_move.rst | ||
| mmctl_command_show.rst | ||
| mmctl_completion.rst | ||
| mmctl_completion_bash.rst | ||
| mmctl_completion_fish.rst | ||
| mmctl_completion_powershell.rst | ||
| mmctl_completion_zsh.rst | ||
| mmctl_compliance-export.rst | ||
| mmctl_compliance-export_cancel.rst | ||
| mmctl_compliance-export_create.rst | ||
| mmctl_compliance-export_download.rst | ||
| mmctl_compliance-export_list.rst | ||
| mmctl_compliance-export_show.rst | ||
| mmctl_config.rst | ||
| mmctl_config_edit.rst | ||
| mmctl_config_export.rst | ||
| mmctl_config_get.rst | ||
| mmctl_config_migrate.rst | ||
| mmctl_config_patch.rst | ||
| mmctl_config_reload.rst | ||
| mmctl_config_reset.rst | ||
| mmctl_config_set.rst | ||
| mmctl_config_show.rst | ||
| mmctl_config_subpath.rst | ||
| mmctl_docs.rst | ||
| mmctl_export.rst | ||
| mmctl_export_create.rst | ||
| mmctl_export_delete.rst | ||
| mmctl_export_download.rst | ||
| mmctl_export_generate-presigned-url.rst | ||
| mmctl_export_job.rst | ||
| mmctl_export_job_cancel.rst | ||
| mmctl_export_job_list.rst | ||
| mmctl_export_job_show.rst | ||
| mmctl_export_list.rst | ||
| mmctl_extract.rst | ||
| mmctl_extract_job.rst | ||
| mmctl_extract_job_list.rst | ||
| mmctl_extract_job_show.rst | ||
| mmctl_extract_run.rst | ||
| mmctl_group.rst | ||
| mmctl_group_channel.rst | ||
| mmctl_group_channel_disable.rst | ||
| mmctl_group_channel_enable.rst | ||
| mmctl_group_channel_list.rst | ||
| mmctl_group_channel_status.rst | ||
| mmctl_group_list-ldap.rst | ||
| mmctl_group_team.rst | ||
| mmctl_group_team_disable.rst | ||
| mmctl_group_team_enable.rst | ||
| mmctl_group_team_list.rst | ||
| mmctl_group_team_status.rst | ||
| mmctl_group_user.rst | ||
| mmctl_group_user_restore.rst | ||
| mmctl_import.rst | ||
| mmctl_import_delete.rst | ||
| mmctl_import_job.rst | ||
| mmctl_import_job_list.rst | ||
| mmctl_import_job_show.rst | ||
| mmctl_import_list.rst | ||
| mmctl_import_list_available.rst | ||
| mmctl_import_list_incomplete.rst | ||
| mmctl_import_process.rst | ||
| mmctl_import_upload.rst | ||
| mmctl_import_validate.rst | ||
| mmctl_integrity.rst | ||
| mmctl_job.rst | ||
| mmctl_job_list.rst | ||
| mmctl_job_update.rst | ||
| mmctl_ldap.rst | ||
| mmctl_ldap_idmigrate.rst | ||
| mmctl_ldap_job.rst | ||
| mmctl_ldap_job_list.rst | ||
| mmctl_ldap_job_show.rst | ||
| mmctl_ldap_sync.rst | ||
| mmctl_license.rst | ||
| mmctl_license_remove.rst | ||
| mmctl_license_upload-string.rst | ||
| mmctl_license_upload.rst | ||
| mmctl_logs.rst | ||
| mmctl_oauth.rst | ||
| mmctl_oauth_list.rst | ||
| mmctl_permissions.rst | ||
| mmctl_permissions_add.rst | ||
| mmctl_permissions_remove.rst | ||
| mmctl_permissions_reset.rst | ||
| mmctl_permissions_role.rst | ||
| mmctl_permissions_role_assign.rst | ||
| mmctl_permissions_role_show.rst | ||
| mmctl_permissions_role_unassign.rst | ||
| mmctl_plugin.rst | ||
| mmctl_plugin_add.rst | ||
| mmctl_plugin_delete.rst | ||
| mmctl_plugin_disable.rst | ||
| mmctl_plugin_enable.rst | ||
| mmctl_plugin_install-url.rst | ||
| mmctl_plugin_list.rst | ||
| mmctl_plugin_marketplace.rst | ||
| mmctl_plugin_marketplace_install.rst | ||
| mmctl_plugin_marketplace_list.rst | ||
| mmctl_post.rst | ||
| mmctl_post_create.rst | ||
| mmctl_post_delete.rst | ||
| mmctl_post_list.rst | ||
| mmctl_roles.rst | ||
| mmctl_roles_member.rst | ||
| mmctl_roles_system-admin.rst | ||
| mmctl_saml.rst | ||
| mmctl_saml_auth-data-reset.rst | ||
| mmctl_sampledata.rst | ||
| mmctl_system.rst | ||
| mmctl_system_clearbusy.rst | ||
| mmctl_system_getbusy.rst | ||
| mmctl_system_setbusy.rst | ||
| mmctl_system_status.rst | ||
| mmctl_system_supportpacket.rst | ||
| mmctl_system_version.rst | ||
| mmctl_team.rst | ||
| mmctl_team_archive.rst | ||
| mmctl_team_create.rst | ||
| mmctl_team_delete.rst | ||
| mmctl_team_list.rst | ||
| mmctl_team_modify.rst | ||
| mmctl_team_rename.rst | ||
| mmctl_team_restore.rst | ||
| mmctl_team_search.rst | ||
| mmctl_team_users.rst | ||
| mmctl_team_users_add.rst | ||
| mmctl_team_users_remove.rst | ||
| mmctl_token.rst | ||
| mmctl_token_generate.rst | ||
| mmctl_token_list.rst | ||
| mmctl_token_revoke.rst | ||
| mmctl_user.rst | ||
| mmctl_user_activate.rst | ||
| mmctl_user_attributes.rst | ||
| mmctl_user_attributes_field.rst | ||
| mmctl_user_attributes_field_create.rst | ||
| mmctl_user_attributes_field_delete.rst | ||
| mmctl_user_attributes_field_edit.rst | ||
| mmctl_user_attributes_field_list.rst | ||
| mmctl_user_attributes_value.rst | ||
| mmctl_user_attributes_value_list.rst | ||
| mmctl_user_attributes_value_set.rst | ||
| mmctl_user_change-password.rst | ||
| mmctl_user_convert.rst | ||
| mmctl_user_create.rst | ||
| mmctl_user_deactivate.rst | ||
| mmctl_user_delete.rst | ||
| mmctl_user_deleteall.rst | ||
| mmctl_user_demote.rst | ||
| mmctl_user_edit.rst | ||
| mmctl_user_edit_authdata.rst | ||
| mmctl_user_edit_email.rst | ||
| mmctl_user_edit_username.rst | ||
| mmctl_user_invite.rst | ||
| mmctl_user_list.rst | ||
| mmctl_user_migrate-auth.rst | ||
| mmctl_user_preference.rst | ||
| mmctl_user_preference_delete.rst | ||
| mmctl_user_preference_get.rst | ||
| mmctl_user_preference_list.rst | ||
| mmctl_user_preference_set.rst | ||
| mmctl_user_promote.rst | ||
| mmctl_user_reset-password.rst | ||
| mmctl_user_resetmfa.rst | ||
| mmctl_user_search.rst | ||
| mmctl_user_verify.rst | ||
| mmctl_version.rst | ||
| mmctl_webhook.rst | ||
| mmctl_webhook_create-incoming.rst | ||
| mmctl_webhook_create-outgoing.rst | ||
| mmctl_webhook_delete.rst | ||
| mmctl_webhook_list.rst | ||
| mmctl_webhook_modify-incoming.rst | ||
| mmctl_webhook_modify-outgoing.rst | ||
| mmctl_webhook_show.rst | ||
| mmctl_websocket.rst | ||