mirror of
https://gh.wpcy.net/https://github.com/discourse/discourse.git
synced 2026-06-19 04:54:30 +08:00
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.
33 lines
815 B
Ruby
Vendored
33 lines
815 B
Ruby
Vendored
# frozen_string_literal: true
|
|
|
|
Migrations::Tooling::Schema.table :topics do
|
|
index :archetype
|
|
|
|
ignore :bumped_at,
|
|
:excerpt,
|
|
:fancy_title,
|
|
:featured_user1_id,
|
|
:featured_user2_id,
|
|
:featured_user3_id,
|
|
:featured_user4_id,
|
|
:has_summary,
|
|
:highest_post_number,
|
|
:highest_staff_post_number,
|
|
:image_upload_id,
|
|
:incoming_link_count,
|
|
:last_post_user_id,
|
|
:last_posted_at,
|
|
:like_count,
|
|
:moderator_posts_count,
|
|
:notify_moderators_count,
|
|
:participant_count,
|
|
:percent_rank,
|
|
:posts_count,
|
|
:reply_count,
|
|
:reviewable_score,
|
|
:score,
|
|
:slug,
|
|
:spam_count,
|
|
:word_count,
|
|
reason: "Calculated columns"
|
|
end
|