Set crown if organisation_type is updated on service.

Add some tests.
Update the initial values of crown.
This commit is contained in:
Rebecca Law
2017-12-04 16:07:26 +00:00
parent f73319f5ef
commit 7fa4e7ffc7
4 changed files with 35 additions and 0 deletions

View File

@@ -19,6 +19,10 @@ def upgrade():
update services set crown = True
where organisation_type = 'central'
""")
op.execute("""
update services set crown = True
where organisation_type is null
""")
op.execute("""
update services set crown = False
where crown is null
@@ -30,6 +34,10 @@ def upgrade():
update services_history set crown = True
where organisation_type = 'central'
""")
op.execute("""
update services_history set crown = True
where organisation_type is null
""")
op.execute("""
update services_history set crown = False
where crown is null