mirror of
https://github.com/GSA/notifications-api.git
synced 2026-02-01 15:46:07 -05:00
Add platform_admin boolean on the User data model.
This commit is contained in:
33
migrations/versions/0041_platform_admin.py
Normal file
33
migrations/versions/0041_platform_admin.py
Normal file
@@ -0,0 +1,33 @@
|
||||
"""empty message
|
||||
|
||||
Revision ID: 0041_platform_admin
|
||||
Revises: 0040_add_reference
|
||||
Create Date: 2016-03-16 16:33:15.279429
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '0041_platform_admin'
|
||||
down_revision = '0040_add_reference'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_index(op.f('ix_notification_statistics_service_id'), 'notification_statistics', ['service_id'], unique=False)
|
||||
op.drop_index('ix_service_notification_stats_service_id', table_name='notification_statistics')
|
||||
op.add_column('users', sa.Column('platform_admin', sa.Boolean(), nullable=True, default=False))
|
||||
op.get_bind()
|
||||
op.execute('update users set platform_admin = False')
|
||||
op.alter_column('users', 'platform_admin', nullable=False)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade():
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column('users', 'platform_admin')
|
||||
op.create_index('ix_service_notification_stats_service_id', 'notification_statistics', ['service_id'], unique=False)
|
||||
op.drop_index(op.f('ix_notification_statistics_service_id'), table_name='notification_statistics')
|
||||
### end Alembic commands ###
|
||||
Reference in New Issue
Block a user