mirror of
https://github.com/GSA/notifications-api.git
synced 2026-08-20 14:29:25 -04:00
Add and populate crown column to services and services_history
- 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
This commit is contained in:
@@ -172,6 +172,7 @@ def dao_create_service(service, user, service_id=None, service_permissions=None)
|
||||
service.id = service_id or uuid.uuid4() # must be set now so version history model can use same id
|
||||
service.active = True
|
||||
service.research_mode = False
|
||||
service.crown = service.organisation_type == 'central'
|
||||
|
||||
for permission in service_permissions:
|
||||
service_permission = ServicePermission(service_id=service.id, permission=permission)
|
||||
|
||||
@@ -249,6 +249,7 @@ class Service(db.Model, Versioned):
|
||||
db.String(255),
|
||||
nullable=True,
|
||||
)
|
||||
crown = db.Column(db.Boolean, index=False, nullable=False, default=True)
|
||||
|
||||
association_proxy('permissions', 'service_permission_types')
|
||||
|
||||
|
||||
Reference in New Issue
Block a user