<filename>portal/trash/migrations/versions/4d075534c323_.py<gh_stars>0
"""empty message

Revision ID: 4d075534c323
Revises: 
Create Date: 2019-03-14 11:08:01.999116

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('message',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('orgs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('short_name', sa.String(length=128), nullable=True),
    sa.Column('notes', sa.String(length=256), nullable=True),
    sa.Column('ts_created', sa.DateTime(), nullable=True),
    sa.Column('ts_updated', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('products',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('short_name', sa.String(length=128), nullable=True),
    sa.Column('notes', sa.String(length=256), nullable=True),
    sa.Column('license_id', sa.Integer(), nullable=True),
    sa.Column('ts_created', sa.DateTime(), nullable=True),
    sa.Column('ts_updated', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_products_license_id'), 'products', ['license_id'], unique=False)
    op.create_table('licenses',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('product_id', sa.Integer(), nullable=True),
    sa.Column('uuid', sa.String(length=128), nullable=True),
    sa.Column('private_key', sa.String(length=128), nullable=True),
    sa.Column('public_key', sa.String(length=128), nullable=True),
    sa.Column('expiration_date', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['product_id'], ['products.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('org_id', sa.Integer(), nullable=True),
    sa.Column('password_hash', sa.String(length=128), nullable=True),
    sa.Column('email', sa.String(length=128), nullable=True),
    sa.Column('mobile_phone', sa.String(length=20), nullable=True),
    sa.Column('recovery_email', sa.String(length=128), nullable=True),
    sa.Column('recovery_mobile_phone', sa.String(length=20), nullable=True),
    sa.Column('reset_token', sa.String(length=128), nullable=True),
    sa.Column('reset_complete', sa.Boolean(), nullable=True),
    sa.Column('status', sa.String(length=1), nullable=True),
    sa.Column('sms', sa.String(length=128), nullable=True),
    sa.Column('failed', sa.String(length=128), nullable=True),
    sa.Column('otp_secret', sa.String(length=64), nullable=True),
    sa.Column('notes', sa.String(length=256), nullable=True),
    sa.Column('ts_created', sa.DateTime(), nullable=True),
    sa.Column('ts_updated', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['org_id'], ['orgs.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_users_email'), 'users', ['email'], unique=False)
    op.create_index(op.f('ix_users_mobile_phone'), 'users', ['mobile_phone'], unique=False)
    op.create_index(op.f('ix_users_recovery_mobile_phone'), 'users', ['recovery_mobile_phone'], unique=False)
    op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=False)
    op.create_table('auth',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('failed_login_count_without_success', sa.Integer(), nullable=True),
    sa.Column('last_successful_login_timestamp', sa.DateTime(), nullable=True),
    sa.Column('last_failed_login_timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('auth')
    op.drop_index(op.f('ix_users_username'), table_name='users')
    op.drop_index(op.f('ix_users_recovery_mobile_phone'), table_name='users')
    op.drop_index(op.f('ix_users_mobile_phone'), table_name='users')
    op.drop_index(op.f('ix_users_email'), table_name='users')
    op.drop_table('users')
    op.drop_table('licenses')
    op.drop_index(op.f('ix_products_license_id'), table_name='products')
    op.drop_table('products')
    op.drop_table('orgs')
    op.drop_table('message')
    # ### end Alembic commands ###

<filename>portal/trash/migrations/versions/4d075534c323_.py<gh_stars>0
"""empty message

Revision ID: 4d075534c323
Revises: 
Create Date: 2019-03-14 11:08:01.999116

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '<KEY>'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('message',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('orgs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('short_name', sa.String(length=128), nullable=True),
    sa.Column('notes', sa.String(length=256), nullable=True),
    sa.Column('ts_created', sa.DateTime(), nullable=True),
    sa.Column('ts_updated', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('products',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=128), nullable=True),
    sa.Column('short_name', sa.String(length=128), nullable=True),
    sa.Column('notes', sa.String(length=256), nullable=True),
    sa.Column('license_id', sa.Integer(), nullable=True),
    sa.Column('ts_created', sa.DateTime(), nullable=True),
    sa.Column('ts_updated', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_products_license_id'), 'products', ['license_id'], unique=False)
    op.create_table('licenses',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('product_id', sa.Integer(), nullable=True),
    sa.Column('uuid', sa.String(length=128), nullable=True),
    sa.Column('private_key', sa.String(length=128), nullable=True),
    sa.Column('public_key', sa.String(length=128), nullable=True),
    sa.Column('expiration_date', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['product_id'], ['products.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=64), nullable=True),
    sa.Column('org_id', sa.Integer(), nullable=True),
    sa.Column('password_hash', sa.String(length=128), nullable=True),
    sa.Column('email', sa.String(length=128), nullable=True),
    sa.Column('mobile_phone', sa.String(length=20), nullable=True),
    sa.Column('recovery_email', sa.String(length=128), nullable=True),
    sa.Column('recovery_mobile_phone', sa.String(length=20), nullable=True),
    sa.Column('reset_token', sa.String(length=128), nullable=True),
    sa.Column('reset_complete', sa.Boolean(), nullable=True),
    sa.Column('status', sa.String(length=1), nullable=True),
    sa.Column('sms', sa.String(length=128), nullable=True),
    sa.Column('failed', sa.String(length=128), nullable=True),
    sa.Column('otp_secret', sa.String(length=64), nullable=True),
    sa.Column('notes', sa.String(length=256), nullable=True),
    sa.Column('ts_created', sa.DateTime(), nullable=True),
    sa.Column('ts_updated', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['org_id'], ['orgs.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_users_email'), 'users', ['email'], unique=False)
    op.create_index(op.f('ix_users_mobile_phone'), 'users', ['mobile_phone'], unique=False)
    op.create_index(op.f('ix_users_recovery_mobile_phone'), 'users', ['recovery_mobile_phone'], unique=False)
    op.create_index(op.f('ix_users_username'), 'users', ['username'], unique=False)
    op.create_table('auth',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('user_id', sa.Integer(), nullable=True),
    sa.Column('failed_login_count_without_success', sa.Integer(), nullable=True),
    sa.Column('last_successful_login_timestamp', sa.DateTime(), nullable=True),
    sa.Column('last_failed_login_timestamp', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('auth')
    op.drop_index(op.f('ix_users_username'), table_name='users')
    op.drop_index(op.f('ix_users_recovery_mobile_phone'), table_name='users')
    op.drop_index(op.f('ix_users_mobile_phone'), table_name='users')
    op.drop_index(op.f('ix_users_email'), table_name='users')
    op.drop_table('users')
    op.drop_table('licenses')
    op.drop_index(op.f('ix_products_license_id'), table_name='products')
    op.drop_table('products')
    op.drop_table('orgs')
    op.drop_table('message')
    # ### end Alembic commands ###

empty message  Revision ID: 4d075534c323 Revises:  Create Date: 2019-03-14 11:08:01.999116 # revision identifiers, used by Alembic. # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ### # ### commands auto generated by Alembic - please adjust! ### # ### end Alembic commands ###