Skip to content
Snippets Groups Projects
Forked from ACIDES / Hiboo
648 commits behind the upstream repository.
3fe66efb6088_.py 2.76 KiB
""" empty message

Revision ID: 3fe66efb6088
Revises:
Create Date: 2019-09-14 12:13:37.847931
"""
from alembic import op
import sqlalchemy as sa


revision = '3fe66efb6088'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('service',
    sa.Column('protocol', sa.String(length=25), nullable=True),
    sa.Column('name', sa.String(length=255), nullable=True),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('max_profiles', sa.Integer(), nullable=True),
    sa.Column('config', sa.String(), nullable=True),
    sa.Column('uuid', sa.String(length=36), nullable=False),
    sa.Column('created_at', sa.Date(), nullable=False),
    sa.Column('updated_at', sa.Date(), nullable=True),
    sa.Column('comment', sa.String(length=255), nullable=True),
    sa.PrimaryKeyConstraint('uuid')
    )
    op.create_table('user',
    sa.Column('username', sa.String(length=255), nullable=False),
    sa.Column('uuid', sa.String(length=36), nullable=False),
    sa.Column('created_at', sa.Date(), nullable=False),
    sa.Column('updated_at', sa.Date(), nullable=True),
    sa.Column('comment', sa.String(length=255), nullable=True),
    sa.PrimaryKeyConstraint('uuid'),
    sa.UniqueConstraint('username')
    )
    op.create_table('auth',
    sa.Column('user_uuid', sa.String(length=36), nullable=True),
    sa.Column('value', sa.String(), nullable=True),
    sa.Column('extra', sa.String(), nullable=True),
    sa.Column('uuid', sa.String(length=36), nullable=False),
    sa.Column('created_at', sa.Date(), nullable=False),
    sa.Column('updated_at', sa.Date(), nullable=True),
    sa.Column('comment', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['user_uuid'], ['user.uuid'], ),
    sa.PrimaryKeyConstraint('uuid')
    )
    op.create_table('profile',
    sa.Column('user_uuid', sa.String(length=36), nullable=True),
    sa.Column('service_uuid', sa.String(length=36), nullable=True),
    sa.Column('username', sa.String(length=255), nullable=False),
    sa.Column('status', sa.String(length=25), nullable=False),
    sa.Column('uuid', sa.String(length=36), nullable=False),
    sa.Column('created_at', sa.Date(), nullable=False),
    sa.Column('updated_at', sa.Date(), nullable=True),
    sa.Column('comment', sa.String(length=255), nullable=True),
    sa.ForeignKeyConstraint(['service_uuid'], ['service.uuid'], ),
    sa.ForeignKeyConstraint(['user_uuid'], ['user.uuid'], ),
    sa.PrimaryKeyConstraint('uuid')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('profile')
    op.drop_table('auth')
    op.drop_table('user')
    op.drop_table('service')
    # ### end Alembic commands ###