Skip to content

#31439 fix: publish restricted-word saves without dropping the live tables - #2050

Merged
Oluwapizzy merged 8 commits into
mainfrom
feature-restricted-word-save
Nov 12, 2026
Merged

Oluwapizzy merged 8 commits into
mainfrom
feature-restricted-word-save

Conversation

@Oluwapizzy

@Oluwapizzy Oluwapizzy commented Nov 12, 2026 •

Copy link
Copy Markdown
Collaborator

*Issue #:*bcgov/entity#31439

Description of changes:

  • A Restricted Word Condition save writes the full screen list into the scratch tables, then deletes and copies those rows into the existing live tables. Primary keys and grants stay. A crash before the final commit keeps the previous words.
  • A create uses that same rebuild. Per-word savepoints are removed so a full save no longer dies on the recursion limit.
  • Three Alembic revisions create the scratch tables and add the screen id and the audit id sequence only where they are missing. - - Bumped Solr admin version to 0.1.2.

Test plan

  • Dev and test: create, edit, and delete one group. The live primary keys stay, and NameX shows the new consent word.
  • Delete the test groups before prod.
  • Prod: deploy the API, then the solr admin app. The first save publishes the whole screen list.

By submitting this pull request, I confirm that you can use, modify, copy, and redistribute this contribution, under the terms of the namex license (Apache 2.0).

The replace never ran because db was undefined, and a create never copied scratch rows onto the enforcement tables. Copy into the existing tables so keys and grants stay.
A flush left each begin_nested open, and the final commit walked that chain until Python hit its recursion limit. The test save died before the live tables were copied.
Hand-created tables are not in the migration history. This revision recreates them so the API migration job applies the schema, and the API version moves to 1.3.1.
Dev cannot create a screen row because virtual_word_condition.id has no sequence. This revision adds that sequence only where it is missing.
A save on dev writes the word and then fails while inserting the audit row, because that id has no sequence. This revision adds the sequence only where it is missing.
@stevenc987

Copy link
Copy Markdown
Collaborator

There are some errors here:
image

@Oluwapizzy

Copy link
Copy Markdown
Collaborator Author

There are some errors here: image

The failing CI's were existing prior, we can fix them in a seperate ticket

@sonarqubecloud

Copy link
Copy Markdown

@Oluwapizzy
Oluwapizzy merged commit a946b4f into main Nov 12, 2026
18 of 20 checks passed
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