Change services.id to a UUID

Ideally all the primary keys in the db would be UUID in order to guarantee unique ids across distributed dbs.
This updates the services.id to a UUID. All the tables with a foreign key to the services.id are also updated.
The endpoints no longer state a data type of the <service_id> path param.
All the tests are updated to reflect this update.

The thing to pay attention to is the 0011_uuid_service_id.py migration script.
This commit must go with a commit on the notifications_admin app to keep things working.
There will be a small outage until both deploys have happened.
This commit is contained in:
Rebecca Law
2016-02-02 14:16:08 +00:00
parent 1277837e00
commit b5c662eca8
15 changed files with 195 additions and 63 deletions

View File

@@ -34,9 +34,12 @@ def test_api_key_should_return_error_when_service_does_not_exist(notify_api, not
sample_service):
with notify_api.test_request_context():
with notify_api.test_client() as client:
auth_header = create_authorization_header(path=url_for('service.renew_api_key', service_id="123"),
import uuid
missing_service_id = uuid.uuid4()
auth_header = create_authorization_header(path=url_for('service.renew_api_key',
service_id=missing_service_id),
method='POST')
response = client.post(url_for('service.renew_api_key', service_id=123),
response = client.post(url_for('service.renew_api_key', service_id=missing_service_id),
headers=[('Content-Type', 'application/json'), auth_header])
assert response.status_code == 404