Add a type table for broadcast providers

This adds a type table for broadcast providers, which is the pattern we
follow with our models (e.g. we have a `broadcast_channel_types` table).

As well as the four providers, the migration populates it with `all`
which is the value that will replace `null` in a later change.

It should be safe to add the foreign key constraint to the
`service_broadcast_settings` in the same migration since the column is
still nullable and we don't have data in that column that is not in the
types table.
This commit is contained in:
Katie Smith
2021-05-05 15:24:49 +01:00
parent 46fe3fca23
commit aec631f208
3 changed files with 41 additions and 2 deletions

View File

@@ -120,7 +120,8 @@ def notify_db_session(notify_db, sms_providers):
"broadcast_status_type",
"invite_status_type",
"service_callback_type",
"broadcast_channel_types"]:
"broadcast_channel_types",
"broadcast_provider_types"]:
notify_db.engine.execute(tbl.delete())
notify_db.session.commit()