mirror of
https://github.com/mattermost/mattermost.git
synced 2026-02-16 00:58:36 -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> |
||
|---|---|---|
| .. | ||
| testdata | ||
| access.go | ||
| access_policy.go | ||
| access_policy_test.go | ||
| access_request.go | ||
| access_test.go | ||
| analytics_row.go | ||
| audit.go | ||
| audit_events.go | ||
| audit_record.go | ||
| auditconv.go | ||
| auditconv_test.go | ||
| audits.go | ||
| authorize.go | ||
| authorize_test.go | ||
| autotranslation.go | ||
| bot.go | ||
| bot_test.go | ||
| builtin.go | ||
| builtin_test.go | ||
| bulk_export.go | ||
| bundle_info.go | ||
| bundle_info_test.go | ||
| cel.go | ||
| channel.go | ||
| channel_bookmark.go | ||
| channel_bookmark_test.go | ||
| channel_count.go | ||
| channel_data.go | ||
| channel_list.go | ||
| channel_member.go | ||
| channel_member_history.go | ||
| channel_member_history_result.go | ||
| channel_member_test.go | ||
| channel_mentions.go | ||
| channel_search.go | ||
| channel_sidebar.go | ||
| channel_sidebar_test.go | ||
| channel_stats.go | ||
| channel_test.go | ||
| channel_view.go | ||
| client4.go | ||
| client4_test.go | ||
| cloud.go | ||
| cluster_discovery.go | ||
| cluster_discovery_test.go | ||
| cluster_info.go | ||
| cluster_message.go | ||
| cluster_stats.go | ||
| command.go | ||
| command_args.go | ||
| command_args_test.go | ||
| command_autocomplete.go | ||
| command_autocomplete_test.go | ||
| command_request.go | ||
| command_response.go | ||
| command_response_test.go | ||
| command_test.go | ||
| command_webhook.go | ||
| command_webhook_test.go | ||
| compliance.go | ||
| compliance_post.go | ||
| compliance_post_test.go | ||
| config.go | ||
| config_test.go | ||
| content_flagging.go | ||
| content_flagging_setting_request.go | ||
| content_flagging_settings.go | ||
| content_flagging_settings_test.go | ||
| content_flagging_test.go | ||
| custom_profile_attributes.go | ||
| custom_profile_attributes_test.go | ||
| custom_status.go | ||
| data_retention_policy.go | ||
| draft.go | ||
| draft_test.go | ||
| email_notification.go | ||
| emoji.go | ||
| emoji_data.go | ||
| emoji_search.go | ||
| emoji_test.go | ||
| example_channel_test.go | ||
| feature_flags.go | ||
| feature_flags_test.go | ||
| file.go | ||
| file_info.go | ||
| file_info_list.go | ||
| file_info_search_results.go | ||
| file_info_test.go | ||
| github_release.go | ||
| gitlab.go | ||
| group.go | ||
| group_member.go | ||
| group_syncable.go | ||
| group_syncable_test.go | ||
| group_test.go | ||
| guest_invite.go | ||
| hosted_customer.go | ||
| incoming_webhook.go | ||
| incoming_webhook_test.go | ||
| initial_load.go | ||
| integration_action.go | ||
| integration_action_test.go | ||
| integrity.go | ||
| ip_filtering.go | ||
| job.go | ||
| job_test.go | ||
| ldap.go | ||
| license.go | ||
| license_test.go | ||
| limits.go | ||
| link_metadata.go | ||
| link_metadata_test.go | ||
| manifest.go | ||
| manifest_test.go | ||
| map.go | ||
| map_test.go | ||
| marketplace_plugin.go | ||
| member_invite.go | ||
| mention_map.go | ||
| mention_map_test.go | ||
| message_export.go | ||
| metrics.go | ||
| metrics_test.go | ||
| mfa_secret.go | ||
| migration.go | ||
| modeltestlib_test.go | ||
| notification.go | ||
| notify_admin.go | ||
| oauth.go | ||
| oauth_dcr.go | ||
| oauth_dcr_test.go | ||
| oauth_metadata.go | ||
| oauth_test.go | ||
| onboarding.go | ||
| outgoing_oauth_connection.go | ||
| outgoing_oauth_connection_test.go | ||
| outgoing_webhook.go | ||
| outgoing_webhook_test.go | ||
| packet_metadata.go | ||
| packet_metadata_test.go | ||
| permalink.go | ||
| permission.go | ||
| permission_test.go | ||
| plugin_cluster_event.go | ||
| plugin_constants.go | ||
| plugin_event_data.go | ||
| plugin_key_value.go | ||
| plugin_key_value_test.go | ||
| plugin_kvset_options.go | ||
| plugin_on_install_event.go | ||
| plugin_reattach.go | ||
| plugin_status.go | ||
| plugin_valid.go | ||
| plugin_valid_test.go | ||
| plugins_response.go | ||
| post.go | ||
| post_acknowledgement.go | ||
| post_embed.go | ||
| post_info.go | ||
| post_list.go | ||
| post_list_test.go | ||
| post_metadata.go | ||
| post_reporting_test.go | ||
| post_search_results.go | ||
| post_test.go | ||
| preference.go | ||
| preference_test.go | ||
| product_notices.go | ||
| property_field.go | ||
| property_field_test.go | ||
| property_group.go | ||
| property_value.go | ||
| property_value_test.go | ||
| push_notification.go | ||
| push_notification_test.go | ||
| push_response.go | ||
| push_response_test.go | ||
| reaction.go | ||
| reaction_test.go | ||
| read_receipt.go | ||
| recap.go | ||
| remote_cluster.go | ||
| remote_cluster_test.go | ||
| report.go | ||
| role.go | ||
| role_test.go | ||
| saml.go | ||
| scheduled_post.go | ||
| scheduled_task.go | ||
| scheduled_task_test.go | ||
| scheme.go | ||
| search_params.go | ||
| search_params_test.go | ||
| security_bulletin.go | ||
| service_environment.go | ||
| service_environment_dev_default.go | ||
| service_environment_production_default.go | ||
| service_environment_test.go | ||
| session.go | ||
| session_serial_gen.go | ||
| session_test.go | ||
| shared_channel.go | ||
| shared_channel_test.go | ||
| slack_attachment.go | ||
| slack_attachment_test.go | ||
| slack_compatibility.go | ||
| slack_compatibility_test.go | ||
| status.go | ||
| status_test.go | ||
| suggest_command.go | ||
| support_packet.go | ||
| switch_request.go | ||
| system.go | ||
| team.go | ||
| team_member.go | ||
| team_member_serial_gen.go | ||
| team_member_test.go | ||
| team_search.go | ||
| team_stats.go | ||
| team_test.go | ||
| temporary_post.go | ||
| terms_of_service.go | ||
| terms_of_service_test.go | ||
| thread.go | ||
| thread_test.go | ||
| token.go | ||
| typing_request.go | ||
| upload_session.go | ||
| upload_session_test.go | ||
| usage.go | ||
| user.go | ||
| user_access_token.go | ||
| user_access_token_search.go | ||
| user_access_token_test.go | ||
| user_autocomplete.go | ||
| user_count.go | ||
| user_get.go | ||
| user_search.go | ||
| user_serial_gen.go | ||
| user_terms_of_service.go | ||
| user_terms_of_service_test.go | ||
| user_test.go | ||
| users_stats.go | ||
| utils.go | ||
| utils_serial_gen.go | ||
| utils_test.go | ||
| version.go | ||
| version_test.go | ||
| websocket_client.go | ||
| websocket_client_test.go | ||
| websocket_message.go | ||
| websocket_message_test.go | ||
| websocket_request.go | ||
| wrangler.go | ||