From 42f2065920c806c214f93f87a6da0b34b14e55b5 Mon Sep 17 00:00:00 2001 From: Rebecca Law Date: Thu, 25 Feb 2016 15:16:00 +0000 Subject: [PATCH] Migration file to add unique constraint on user_to_service. --- .../versions/0024_uix_user_to_service.py | 26 +++++++++++++++++++ 1 file changed, 26 insertions(+) create mode 100644 migrations/versions/0024_uix_user_to_service.py diff --git a/migrations/versions/0024_uix_user_to_service.py b/migrations/versions/0024_uix_user_to_service.py new file mode 100644 index 000000000..63b131c68 --- /dev/null +++ b/migrations/versions/0024_uix_user_to_service.py @@ -0,0 +1,26 @@ +"""empty message + +Revision ID: 0024_uix_user_to_service +Revises: 0023_drop_token +Create Date: 2016-02-25 11:15:06.088508 + +""" + +# revision identifiers, used by Alembic. +revision = '0024_uix_user_to_service' +down_revision = '0023_drop_token' + +from alembic import op +import sqlalchemy as sa + + +def upgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.create_unique_constraint('uix_user_to_service', 'user_to_service', ['user_id', 'service_id']) + ### end Alembic commands ### + + +def downgrade(): + ### commands auto generated by Alembic - please adjust! ### + op.drop_constraint('uix_user_to_service', 'user_to_service', type_='unique') + ### end Alembic commands ###