The response files we receive from the DVLA when we send letters
contain a row for each letter and a field with a value of 'Unsorted' or
'Sorted'. This table will be used to store the total number of
'Unsorted' and 'Sorted' letter notifications per day.
Since we send all one off messages as priority
[now](https://github.com/alphagov/notifications-api/pull/1722), we don’t
need to explicitly mark the ‘Example text message template’ template as
being priority.
This commit retroactively removes the priority flag from these
templates, so that they can’t be reused to send other messages as
priority. I don’t think this is a real problem now, but worth cleaning
this up.
This query will hit approximately 827 templates.
Since the application code gets released after the migration setting
a new Template field as non-nullable prevents new templates from being
created by the existing application instances.
This splits the migration to set fields as nullable first and then
update existing records once the application code has been released.
0168 is modified not to run UPDATE query or set non-nullable flag in
staging and production. 0169 is added to rollback preview.
Creates the column as nullable, sets the value to false for all
existing templates and template versions and then applies a
not-nullable constraint.
All future Templates are created with `False` as the default set
in SQLAlchemy.
we have problems where govuk service is not migrated to sms_senders on new datbases.
update this old script so we don't affect live systems, but when people rebuild their
database from scratch they get the sms sender for govuk notify.
Will specifically affect the email auth template, which was seeded
without a matching row in the `template_redacted` table.
Effectively re-runs c24edcf388
> add historical redaction data
>
> every current template gets a row in the template_redacted table -
> this inserts one for any template that doesn't already have a row,
> with redact set to false, the user set to NOTIFY_USER since it was
> just a script, and the updated_at set to the time the script is run
The default for the rate_limit column in the services and
services_history model is now set in the model, so we can remove the
default from the database.
Pivotal story: https://www.pivotaltracker.com/story/show/153992529
The API rate limit will be removed from the config and added to services
so that it is possible to change the rate_limit for individual services
in rare cases.
Pivotal story: https://www.pivotaltracker.com/story/show/153992529
There is no need for the extra column.
If a template does not have a default address set - they address will be blank.
Otherwise use the address of the service_letter_contact.
There will be another PR to do a db migration.
Template.service_letter_contact = blank if no service_letter_contacts for service ELSE use set Template.serivce_letter_contact_id = service default service_letter_contact
If is_letter_contact_blank then the user has set the letter contact block to be blank on purpose
ELSE IF is_letter_contact_blank is false THEN use the template default
IF template default is blank THEN the service_letter_contact is blank use the service default
- Added the boolean 'crown' column to services and services_history tables
- We populate this column in the same migration script by checking the
'organisation_type' of a service