<gh_stars>0
"""add_users_and_places_table

Revision ID: <PASSWORD>
Revises: 
Create Date: 2021-11-14 23:12:36.952798

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('places',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('keyname', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_places'))
    )
    with op.batch_alter_table('places', schema=None) as batch_op:
        batch_op.create_index(batch_op.f('ix_places_keyname'), ['keyname'], unique=False)
        batch_op.create_index(batch_op.f('ix_places_name'), ['name'], unique=False)

    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('email', sa.String(), nullable=True),
    sa.Column('password', sa.String(), nullable=True),
    sa.Column('place_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['place_id'], ['places.id'], name=op.f('fk_users_place_id_places')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_users')),
    sa.UniqueConstraint('email', name=op.f('uq_users_email'))
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('users')
    with op.batch_alter_table('places', schema=None) as batch_op:
        batch_op.drop_index(batch_op.f('ix_places_name'))
        batch_op.drop_index(batch_op.f('ix_places_keyname'))

    op.drop_table('places')
    # ### end Alembic commands ###

"""add_users_and_places_table

Revision ID: <PASSWORD>
Revises: 
Create Date: 2021-11-14 23:12:36.952798

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('places',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('keyname', sa.String(length=64), nullable=True),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_places'))
    )
    with op.batch_alter_table('places', schema=None) as batch_op:
        batch_op.create_index(batch_op.f('ix_places_keyname'), ['keyname'], unique=False)
        batch_op.create_index(batch_op.f('ix_places_name'), ['name'], unique=False)

    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=True),
    sa.Column('email', sa.String(), nullable=True),
    sa.Column('password', sa.String(), nullable=True),
    sa.Column('place_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['place_id'], ['places.id'], name=op.f('fk_users_place_id_places')),
    sa.PrimaryKeyConstraint('id', name=op.f('pk_users')),
    sa.UniqueConstraint('email', name=op.f('uq_users_email'))
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('users')
    with op.batch_alter_table('places', schema=None) as batch_op:
        batch_op.drop_index(batch_op.f('ix_places_name'))
        batch_op.drop_index(batch_op.f('ix_places_keyname'))

    op.drop_table('places')
    # ### end Alembic commands ###
add_users_and_places_table  Revision ID: <PASSWORD> Revises:  Create Date: 2021-11-14 23:12:36.952798 # 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 ###