From c4013140720f3fd9d128c1cbaa3554436ecf360f Mon Sep 17 00:00:00 2001 From: Katie Smith Date: Tue, 10 Apr 2018 16:48:56 +0100 Subject: [PATCH] Add is_active column for the 3 reply_to tables Added a new boolean column, `is_active` to these tables * service_email_reply_to * service_sms_senders * service_letter_contacts This has a database default of True in order to backfill the data, but this default will be replaced with a model default later. --- .../0185_add_is_active_to_reply_tos.py | 25 +++++++++++++++++++ 1 file changed, 25 insertions(+) create mode 100644 migrations/versions/0185_add_is_active_to_reply_tos.py diff --git a/migrations/versions/0185_add_is_active_to_reply_tos.py b/migrations/versions/0185_add_is_active_to_reply_tos.py new file mode 100644 index 000000000..9bee4b7a7 --- /dev/null +++ b/migrations/versions/0185_add_is_active_to_reply_tos.py @@ -0,0 +1,25 @@ +""" + +Revision ID: 0185_add_is_active_to_reply_tos +Revises: 0184_alter_primary_key_1 +Create Date: 2018-04-10 16:35:41.824981 + +""" +from alembic import op +import sqlalchemy as sa + + +revision = '0185_add_is_active_to_reply_tos' +down_revision = '0184_alter_primary_key_1' + + +def upgrade(): + op.add_column('service_email_reply_to', sa.Column('is_active', sa.Boolean(), nullable=False, server_default=sa.true())) + op.add_column('service_letter_contacts', sa.Column('is_active', sa.Boolean(), nullable=False, server_default=sa.true())) + op.add_column('service_sms_senders', sa.Column('is_active', sa.Boolean(), nullable=False, server_default=sa.true())) + + +def downgrade(): + op.drop_column('service_sms_senders', 'is_active') + op.drop_column('service_letter_contacts', 'is_active') + op.drop_column('service_email_reply_to', 'is_active')