mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-24 01:11:38 -05:00
Removes "NOT VALID" mark from the notifications -> template_history foreign key constraint by validating existing records. From postgres docs: > This form validates a foreign key or check constraint that was > previously created as NOT VALID, by scanning the table to ensure there > are no rows for which the constraint is not satisfied. Nothing happens > if the constraint is already marked valid. > Validation can be a long process on larger tables. The value of > separating validation from initial creation is that you can defer > validation to less busy times, or can be used to give additional time > to correct pre-existing errors while preventing new errors. Note also > that validation on its own does not prevent normal write commands > against the table while it runs. > Validation acquires only a SHARE UPDATE EXCLUSIVE lock on the table > being altered. If the constraint is a foreign key then a ROW SHARE > lock is also required on the table referenced by the constraint.
Generic single-database configuration. python application.py db migrate to generate migration script. python application.py db upgrade to upgrade db with script. python application.py db downgrade to rollback db changes. python application.py db current to show current script.