mirror of
https://github.com/GSA/notifications-api.git
synced 2025-12-29 11:51:48 -05:00
Add script to set notifications sent count on jobs table.
This commit is contained in:
@@ -16,7 +16,7 @@ import sqlalchemy as sa
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('jobs', sa.Column('notifications_sent', sa.Integer(), nullable=False))
|
||||
op.add_column('jobs', sa.Column('notifications_sent', sa.Integer(), nullable=True))
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
|
||||
27
migrations/versions/0035_default_sent_count.py
Normal file
27
migrations/versions/0035_default_sent_count.py
Normal 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)
|
||||
Reference in New Issue
Block a user