Add script to set notifications sent count on jobs table.

This commit is contained in:
Martyn Inglis
2016-03-08 09:12:33 +00:00
parent f931e3fca6
commit 8d8abb524d
2 changed files with 28 additions and 1 deletions

View File

@@ -0,0 +1,27 @@
"""empty message
Revision ID: 0035_default_sent_count
Revises: 0034_job_sent_count
Create Date: 2016-03-08 09:08:55.721654
"""
# revision identifiers, used by Alembic.
revision = '0035_default_sent_count'
down_revision = '0034_job_sent_count'
from alembic import op
import sqlalchemy as sa
def upgrade():
op.execute('update jobs set notifications_sent = notification_count')
op.alter_column('jobs', 'notifications_sent',
existing_type=sa.INTEGER(),
nullable=False)
def downgrade():
op.alter_column('jobs', 'notifications_sent',
existing_type=sa.INTEGER(),
nullable=True)