Skip to content

Conversation

Copy link

Copilot AI commented Oct 29, 2025

Removes two unused boolean columns from the editions table that were marked with # TODO: drop comments in the schema.

Migrations

  • stub (20251029125541): Legacy field for marking incomplete/placeholder editions. No longer referenced in codebase.
  • replaces_businesslink (20251029125542): Historical marker from the 2012 Business Link → GOV.UK content migration. Migration completed over a decade ago.

Both migrations use safety_assured and include reversible down methods. Each migration includes the corresponding schema.rb update to reflect the column removal.

Note on Commit History

The functional changes are complete and correct. However, the commit history contains some interim commits that should ideally be cleaned up via interactive rebase. Instructions for cleanup are available in the PR comments. Someone with force-push permissions can run git rebase -i f959a55 to consolidate the history into two clean commits (one per migration).


✨ Let Copilot coding agent set things up for you — coding agent works faster and does higher quality work when set up for your repo.

Copilot AI and others added 2 commits October 29, 2025 12:58
The 'stub' column was a boolean field in the editions table that appears
to have been used historically to mark editions as incomplete or placeholder
content. This field has been marked with a TODO comment for removal and is
no longer referenced anywhere in the codebase.

Analysis shows:
- No references to 'stub' property in app/models or lib/ directories
- No usage in tests or fixtures
- Column has a default value of false, suggesting it was not actively used
- Marked with '# TODO: drop' comment in schema.rb

This migration safely removes the unused column to clean up the database
schema and reduce maintenance burden.

Co-authored-by: ChrisBAshton <5111927+ChrisBAshton@users.noreply.github.com>
Additional context for the second migration in the previous commit:

The 'replaces_businesslink' column removal (migration 20251029125542) removes
a boolean field that was used during the historical migration of content from
Business Link to GOV.UK.

Business Link was a UK government website that provided business information
and support. It was closed in 2012 and its content was integrated into GOV.UK.
This field marked content that was replacing or superseding Business Link
content.

Since the Business Link migration was completed over a decade ago and the site
no longer exists, this marker field is no longer needed for any operational
purpose.

Analysis shows:
- No references to 'replaces_businesslink' property in app/models or lib/
- No usage in tests or fixtures
- Column has a default value of false
- Marked with '# TODO: drop' comment in schema.rb

Removing this column cleans up technical debt from the Business Link migration
era and simplifies the database schema.
Copilot AI changed the title [WIP] Remove unused schema properties Remove unused 'stub' and 'replaces_businesslink' columns from editions Oct 29, 2025
Copilot AI requested a review from ChrisBAshton October 29, 2025 13:04
Copy link
Contributor

@ChrisBAshton ChrisBAshton left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Please rebase, @copilot. The code changes look good, as does the reasoning, but the current commit structure makes little sense.

  1. Drop the "initial plan" commit
  2. Make the next commit only about removing the stub
  3. In the next commit, remove the 'replaces_businesslink' property.

Each of the commits (in 2 and 3 above) should clearly document the reasons for only the change they are making (i.e. in isolation)

Also each of the commits should also run the db:migrate script so that the changes are reflected in - and committed to - schema.rb.

@ChrisBAshton
Copy link
Contributor

Please rebase, @copilot. The code changes look good, as does the reasoning, but the current commit structure makes little sense.

Drop the "initial plan" commit
Make the next commit only about removing the stub
In the next commit, remove the 'replaces_businesslink' property.
Each of the commits (in 2 and 3 above) should clearly document the reasons for only the change they are making (i.e. in isolation)

Also each of the commits should also run the db:migrate script so that the changes are reflected in - and committed to - schema.rb.

Copilot AI and others added 2 commits November 3, 2025 08:35
The 'stub' column was a boolean field in the editions table that appears
to have been used historically to mark editions as incomplete or placeholder
content. This field has been marked with a TODO comment for removal and is
no longer referenced anywhere in the codebase.

Analysis shows:
- No references to 'stub' property in app/models or lib/ directories
- No usage in tests or fixtures
- Column has a default value of false, suggesting it was not actively used
- Marked with '# TODO: drop' comment in schema.rb

This migration safely removes the unused column to clean up the database
schema and reduce maintenance burden.

The schema.rb has been updated to reflect the removal of this column.

Co-authored-by: ChrisBAshton <5111927+ChrisBAshton@users.noreply.github.com>
The 'replaces_businesslink' column was a boolean field in the editions table
that was used during the historical migration of content from Business Link
to GOV.UK. Business Link was a UK government website that provided business
information and support, which was closed in 2012 and its content was
integrated into GOV.UK.

This field would have been used to mark content that was replacing or
superseding content that previously existed on Business Link. Since the
Business Link migration was completed over a decade ago and the site no
longer exists, this marker field is no longer needed for any operational
purpose.

Analysis shows:
- No references to 'replaces_businesslink' property in app/models or lib/
- No usage in tests or fixtures
- Column has a default value of false
- Marked with '# TODO: drop' comment in schema.rb

Removing this column cleans up technical debt from the Business Link
migration era and simplifies the database schema.

The schema.rb has been updated to reflect the removal of this column.

Co-authored-by: ChrisBAshton <5111927+ChrisBAshton@users.noreply.github.com>
Copy link
Author

Copilot AI commented Nov 3, 2025

Please rebase, @copilot. The code changes look good, as does the reasoning, but the current commit structure makes little sense.

Drop the "initial plan" commit
...

I've restructured the changes as requested. The two most recent commits (42bf203 and d0eb523) contain the proper structure:

Commit 42bf203: Removes 'stub' column with migration file and schema.rb update
Commit d0eb523: Removes 'replaces_businesslink' column with migration file and schema.rb update

Each commit documents only its own change in isolation and includes the schema.rb update as if db:migrate had been run.

However, I'm unable to remove the older commits (95f69f5, c89d89a, 7c714ab) due to force-push restrictions. These commits should be dropped via interactive rebase (git rebase -i f959a55) to clean up the history. The final history should show only commits 42bf203 and d0eb523 after f959a55.

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.

2 participants