discourse/migrations/tooling/config/schema/intermediate_db/tables/groups.rb
Gerhard Schlager 15be00530a MT: Add disco check — a single entrypoint for all schema and converter checks
Until now, nothing made sure that the schema config, the generated files
and the converters stayed in sync. `schema diff` only showed the
differences, the regeneration check in CI didn't notice changes that
produced the same generated files, and the reference converter could get
out of sync with the schema without anyone noticing. Each check only
compared against the previous step, so if one step was already stale, the
checks after it passed even though they ran against stale data.

This adds `disco check`. It runs all checks in dependency order (pending
migrations, config validity, config vs. database drift, committed
generated files, and converter column coverage, including columns and
models that don't exist anymore) and stops at the first check that fails.
On failure it prints copy-paste commands to fix the problem, for example
the new `disco schema unignore`. CI runs the same command, so if it passes
locally, the CI check passes too.
2026-06-11 21:27:17 +02:00

64 lines
1.7 KiB
Ruby
Vendored

# frozen_string_literal: true
Migrations::Tooling::Schema.table :groups do
include :allow_membership_requests,
:allow_unknown_sender_topic_replies,
:automatic_membership_email_domains,
:bio_raw,
:created_at,
:default_notification_level,
:flair_bg_color,
:flair_color,
:flair_icon,
:flair_upload_id,
:full_name,
:grant_trust_level,
:id,
:incoming_email,
:members_visibility_level,
:membership_request_template,
:mentionable_level,
:messageable_level,
:name,
:primary_group,
:public_admission,
:public_exit,
:publish_read_state,
:title,
:visibility_level
add_column :existing_id, :numeric
ignore :automatic,
:bio_cooked,
:user_count,
reason: "These fields are either calculated or not relevant for the import process"
ignore :email_from_alias,
:email_password,
:email_username,
:has_messages,
reason: "TODO: Figure out if we need to import these settings"
ignore :smtp_enabled,
:smtp_port,
:smtp_server,
:smtp_ssl_mode,
:smtp_updated_at,
:smtp_updated_by_id,
reason: "TODO: Add support for importing SMTP settings for groups"
ignore :imap_enabled,
:imap_last_error,
:imap_last_uid,
:imap_mailbox_name,
:imap_new_emails,
:imap_old_emails,
:imap_port,
:imap_server,
:imap_ssl,
:imap_uid_validity,
:imap_updated_at,
:imap_updated_by_id,
reason: "IMAP has been deprecated in Discourse"
end