Skip to content

Add domain list postgres indexes - #5718

Draft
philippthun wants to merge 2 commits into
cloudfoundry:mainfrom
sap-contributions:add-domain-list-postgres-indexes
Draft

philippthun wants to merge 2 commits into
cloudfoundry:mainfrom
sap-contributions:add-domain-list-postgres-indexes

Conversation

@philippthun

Copy link
Copy Markdown
Member

Thanks for contributing to cloud_controller_ng. To speed up the process of reviewing your pull request please provide us with:

  • A short explanation of the proposed change:

  • An explanation of the use cases your change solves

  • Links to any other associated PRs

  • I have reviewed the contributing guide

  • I have viewed, signed, and submitted the Contributor License Agreement

  • I have made this pull request to the main branch

  • I have run all the unit tests using bundle exec rake

  • I have run CF Acceptance Tests

Replace raw Sequel::Migrator.run calls in migration specs with the
run_migration and revert_migration helpers, and use the
test_up_migration_idempotency / test_down_migration_idempotency
helpers for idempotency checks.

The idempotency helpers assert the expected schema_migrations state,
then delete or insert the row before re-running, so the migration body
is genuinely re-executed. Re-running the migrator to the same target
only is a no-op and does not test idempotency.

Apply each helper only where the migration body supports it: options
like add_column(if_not_exists:) are honoured on PostgreSQL but ignored
on MySQL, so such migrations assert idempotency in a database-gated
context. Single-database migrations are exercised only there, and
migrations with unguarded DDL or no reversible down assert only the
steps that apply. Each added step asserts state in the same style as
the rest of its spec.

Update spec/migrations/Readme.md to document the four helpers and their
preconditions.

Add two custom cops: UseMigrationHelpers flags raw Sequel::Migrator.run
calls in specs that include the shared context, and
RequireMigrationSharedContext flags per-migration specs that omit it.
Legacy and bigint-step specs are excluded via .rubocop_cc.yml.

Teach TooManyMigrationRuns to count the four helpers only when the
migration shared context is included, while retaining detection of
direct migrator calls and local wrappers. Share context detection
across all three cops and add regression coverage for unrelated helper
names and invalid idempotency-check setup.
Create both indexes concurrently and keep MySQL unchanged.
Test their definitions, preservation and up/down idempotency.

This branch has not been deployed

No deployments
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant