diff --git a/migrations/versions/0152_kill_service_free_fragments.py b/migrations/versions/0152_kill_service_free_fragments.py new file mode 100644 index 000000000..038b978da --- /dev/null +++ b/migrations/versions/0152_kill_service_free_fragments.py @@ -0,0 +1,24 @@ +""" + +Revision ID: 0152_kill_service_free_fragments +Revises: 0151_refactor_letter_rates +Create Date: 2017-12-01 16:49:51.178455 + +""" +from alembic import op +import sqlalchemy as sa + +revision = '0152_kill_service_free_fragments' +down_revision = '0151_refactor_letter_rates' + + +def upgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.drop_column('services', 'free_sms_fragment_limit') + op.drop_column('services_history', 'free_sms_fragment_limit') + + +def downgrade(): + # ### commands auto generated by Alembic - please adjust! ### + op.add_column('services_history', sa.Column('free_sms_fragment_limit', sa.BIGINT(), autoincrement=False, nullable=True)) + op.add_column('services', sa.Column('free_sms_fragment_limit', sa.BIGINT(), autoincrement=False, nullable=True)) diff --git a/requirements.txt b/requirements.txt index 0c0b2432e..9b28fa639 100644 --- a/requirements.txt +++ b/requirements.txt @@ -26,7 +26,7 @@ notifications-python-client==4.6.0 awscli==1.14.4 awscli-cwlogs>=1.4,<1.5 -git+https://github.com/alphagov/notifications-utils.git@23.3.1#egg=notifications-utils==23.3.1 +git+https://github.com/alphagov/notifications-utils.git@23.3.4#egg=notifications-utils==23.3.4 git+https://github.com/alphagov/boto.git@2.43.0-patch3#egg=boto==2.43.0-patch3 diff --git a/scripts/fix_migrations.py b/scripts/fix_migrations.py index 3965ed411..4bf07b7cb 100755 --- a/scripts/fix_migrations.py +++ b/scripts/fix_migrations.py @@ -46,8 +46,11 @@ def reorder_revisions(revisions, old_base, new_base): file_data = rev_file.read() file_data = file_data.replace(head.revision, new_revision_id).replace(old_base, new_base) + new_filename = head.path.replace(head.revision, new_revision_id) - with open(head.path.replace(head.revision, new_revision_id), 'w') as rev_file: + assert head.path != new_filename, 'Old filename not same as revision id, please rename file before continuing' + + with open(new_filename, 'w') as rev_file: rev_file.write(file_data) print("Removing {}".format(head.path))