Skip to content

Remove declaration_text from forms (part 2/2) - #3108

Merged
lfdebrux merged 1 commit into
mainfrom
ldeb-remove-declaration-text--part-2
Sep 22, 2026
Merged

lfdebrux merged 1 commit into
mainfrom
ldeb-remove-declaration-text--part-2

Conversation

@lfdebrux

@lfdebrux lfdebrux commented Sep 11, 2026

Copy link
Copy Markdown
Contributor

What problem does this pull request solve?

The declaration_text attribute on the forms model has been replaced with the declaration_markdown attribute and deprecated. It is no longer read in forms-runner or read or updated in forms-admin.

Removing the deprecated attribute completely will simplify the form model and reduce the possibility of confusion.

Removing the attribute from the forms model will not remove it from the form document model or change existing form document contents, but will stop if from being present in new form documents.

This change will prevent declaration_text being copied from a form document to a form model when copying a form form or reverting a draft form, but there are no form documents in the production database which have declaration_text but not declaration_markdown that could cause issues 1.

This PR tells adds migrations and updates the schema to delete the declaration_text column(s).

This PR should not be merged until #3107 has been merged and deployed to production.

Things to consider when reviewing

  • Ensure that you consider the wider context.
  • Does it work when run on your machine?
  • Is it clear what the code is doing?
  • Do the commit messages explain why the changes were made?
  • Are there all the unit tests needed?
  • Do the end to end tests need updating before these changes will pass?
  • Has all relevant documentation been updated?

Footnotes

  1. This was verified with the following SQL query:

     gds aws forms-prod-support -- forms data_api -d forms-admin -s $'SELECT form_id, tag, version, language, content->\'declaration_text\' AS declaration_text, content->\'declaration_markdown\' AS declaration_markdown FROM form_documents WHERE content @@ \'($.declaration_text != null && $.declaration_text != "") && ($.declaration_markdown == null || $.declaration_markdown == "")\';'
    

    Prior to https://github.com/govuk-forms/forms-runner/pull/2334, the only situation when the declaration_text attribute was read was when declaration_markdown was blank.

    There are two forms in the production database where declaration_markdown is blank and declaration_text is present, however, these were reported as bugs by a form creator, as they had wanted to remove the form declaration.

@lfdebrux
lfdebrux force-pushed the ldeb-remove-declaration-text--part-2 branch from b69b0f4 to 6792689 Compare September 11, 2026 11:54
@lfdebrux
lfdebrux force-pushed the ldeb-remove-declaration-text--part-2 branch 2 times, most recently from 50e5227 to d4ef1e5 Compare September 18, 2026 05:51
@lfdebrux
lfdebrux marked this pull request as ready for review September 21, 2026 09:45
stephencdaly
stephencdaly previously approved these changes Sep 21, 2026
@lfdebrux
lfdebrux dismissed stephencdaly’s stale review September 21, 2026 16:10

The merge-base changed after approval.

stephencdaly
stephencdaly previously approved these changes Sep 21, 2026
@lfdebrux
lfdebrux dismissed stephencdaly’s stale review September 22, 2026 05:59

The merge-base changed after approval.

Remove the `declaration_text` column from the `forms` and
`form_translations` tables.
@lfdebrux
lfdebrux enabled auto-merge September 22, 2026 12:21
stephencdaly
stephencdaly previously approved these changes Sep 22, 2026
@lfdebrux
lfdebrux dismissed stephencdaly’s stale review September 22, 2026 12:26

The merge-base changed after approval.

@lfdebrux
lfdebrux force-pushed the ldeb-remove-declaration-text--part-2 branch from d4ef1e5 to f6ddfc9 Compare September 22, 2026 12:28
@github-actions

Copy link
Copy Markdown

🎉 A review copy of this PR has been deployed! You can reach it at: https://pr-3108.admin.review.forms.service.gov.uk/

It may take 5 minutes or so for the application to be fully deployed and working. If it still isn't ready
after 5 minutes, there may be something wrong with the ECS task. You will need to go to the integration AWS account
to debug, or otherwise ask an infrastructure person.

For the sign in details and more information, see the review apps wiki page.

@lfdebrux
lfdebrux added this pull request to the merge queue Sep 22, 2026
Merged via the queue into main with commit 3a32363 Sep 22, 2026
3 checks passed
@lfdebrux
lfdebrux deleted the ldeb-remove-declaration-text--part-2 branch September 22, 2026 12:44
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