mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-09-02 17:48:50 -04:00
45 lines
1.5 KiB
Python
45 lines
1.5 KiB
Python
|
|
"""empty message
|
||
|
|
|
||
|
|
Revision ID: 60_add_service
|
||
|
|
Revises: 50_alter_verify_code_type
|
||
|
|
Create Date: 2015-12-14 15:22:55.938819
|
||
|
|
|
||
|
|
"""
|
||
|
|
|
||
|
|
# revision identifiers, used by Alembic.
|
||
|
|
revision = '60_add_service'
|
||
|
|
down_revision = '50_alter_verify_code_type'
|
||
|
|
|
||
|
|
from alembic import op
|
||
|
|
import sqlalchemy as sa
|
||
|
|
|
||
|
|
|
||
|
|
def upgrade():
|
||
|
|
### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.create_table('services',
|
||
|
|
sa.Column('id', sa.Integer(), nullable=False),
|
||
|
|
sa.Column('name', sa.String(length=255), nullable=False),
|
||
|
|
sa.Column('token_id', sa.BigInteger(), nullable=True),
|
||
|
|
sa.Column('created_at', sa.DateTime(), nullable=False),
|
||
|
|
sa.Column('active', sa.Boolean(), nullable=False),
|
||
|
|
sa.Column('limit', sa.BigInteger(), nullable=False),
|
||
|
|
sa.Column('restricted', sa.Boolean(), nullable=False),
|
||
|
|
sa.PrimaryKeyConstraint('id')
|
||
|
|
)
|
||
|
|
op.create_index(op.f('ix_services_token_id'), 'services', ['token_id'], unique=True)
|
||
|
|
op.create_table('user_to_service',
|
||
|
|
sa.Column('user_id', sa.Integer(), nullable=True),
|
||
|
|
sa.Column('service_id', sa.Integer(), nullable=True),
|
||
|
|
sa.ForeignKeyConstraint(['service_id'], ['services.id'], ),
|
||
|
|
sa.ForeignKeyConstraint(['user_id'], ['users.id'], )
|
||
|
|
)
|
||
|
|
### end Alembic commands ###
|
||
|
|
|
||
|
|
|
||
|
|
def downgrade():
|
||
|
|
### commands auto generated by Alembic - please adjust! ###
|
||
|
|
op.drop_table('user_to_service')
|
||
|
|
op.drop_index(op.f('ix_services_token_id'), table_name='services')
|
||
|
|
op.drop_table('services')
|
||
|
|
### end Alembic commands ###
|