mirror of
https://github.com/GSA/notifications-admin.git
synced 2026-02-05 02:42:26 -05:00
43 lines
1.3 KiB
Python
43 lines
1.3 KiB
Python
"""empty message
|
|
|
|
Revision ID: 60_add_service
|
|
Revises: 50_alter_verify_code_type
|
|
Create Date: 2015-12-15 09:25:09.000431
|
|
|
|
"""
|
|
|
|
# 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('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'),
|
|
sa.UniqueConstraint('name')
|
|
)
|
|
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_table('services')
|
|
### end Alembic commands ###
|