"""empty message

Revision ID: d0c52114eb3d
Revises: 
Create Date: 2020-10-17 15:31:26.104508

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd0c52114eb3d'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('groups',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=200), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=20), nullable=False),
    sa.Column('first_name', sa.String(length=20), nullable=True),
    sa.Column('last_name', sa.String(length=20), nullable=True),
    sa.Column('password', sa.String(length=100), nullable=False),
    sa.Column('email', sa.String(length=120), nullable=False),
    sa.Column('admin', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('groups_and_users',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('group_admin', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['group_id'], ['groups.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('user_id', 'group_id')
    )
    op.create_table('pairs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('timestamp', sa.Date(), nullable=True),
    sa.Column('group_id', sa.Integer(), nullable=True),
    sa.Column('giver_id', sa.Integer(), nullable=True),
    sa.Column('receiver_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['giver_id'], ['users.id'], ),
    sa.ForeignKeyConstraint(['group_id'], ['groups.id'], ),
    sa.ForeignKeyConstraint(['receiver_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('pairs')
    op.drop_table('groups_and_users')
    op.drop_table('users')
    op.drop_table('groups')
    # ### end Alembic commands ###

a2168e2c873f5f398ce357a2d6ee6f7d50351ba6
<mask token>


def downgrade():
    op.drop_table('pairs')
    op.drop_table('groups_and_users')
    op.drop_table('users')
    op.drop_table('groups')

<mask token>


def upgrade():
    op.create_table('groups', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('name', sa.String(length=200), nullable=False), sa.
        PrimaryKeyConstraint('id'), sa.UniqueConstraint('name'))
    op.create_table('users', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('username', sa.String(length=20), nullable=False), sa.
        Column('first_name', sa.String(length=20), nullable=True), sa.
        Column('last_name', sa.String(length=20), nullable=True), sa.Column
        ('password', sa.String(length=100), nullable=False), sa.Column(
        'email', sa.String(length=120), nullable=False), sa.Column('admin',
        sa.Boolean(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.
        UniqueConstraint('email'))
    op.create_table('groups_and_users', sa.Column('user_id', sa.Integer(),
        nullable=False), sa.Column('group_id', sa.Integer(), nullable=False
        ), sa.Column('group_admin', sa.Boolean(), nullable=True), sa.
        ForeignKeyConstraint(['group_id'], ['groups.id']), sa.
        ForeignKeyConstraint(['user_id'], ['users.id']), sa.
        PrimaryKeyConstraint('user_id', 'group_id'))
    op.create_table('pairs', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('timestamp', sa.Date(), nullable=True), sa.Column(
        'group_id', sa.Integer(), nullable=True), sa.Column('giver_id', sa.
        Integer(), nullable=True), sa.Column('receiver_id', sa.Integer(),
        nullable=True), sa.ForeignKeyConstraint(['giver_id'], ['users.id']),
        sa.ForeignKeyConstraint(['group_id'], ['groups.id']), sa.
        ForeignKeyConstraint(['receiver_id'], ['users.id']), sa.
        PrimaryKeyConstraint('id'))


def downgrade():
    op.drop_table('pairs')
    op.drop_table('groups_and_users')
    op.drop_table('users')
    op.drop_table('groups')

<mask token>
revision = 'd0c52114eb3d'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('groups', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('name', sa.String(length=200), nullable=False), sa.
        PrimaryKeyConstraint('id'), sa.UniqueConstraint('name'))
    op.create_table('users', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('username', sa.String(length=20), nullable=False), sa.
        Column('first_name', sa.String(length=20), nullable=True), sa.
        Column('last_name', sa.String(length=20), nullable=True), sa.Column
        ('password', sa.String(length=100), nullable=False), sa.Column(
        'email', sa.String(length=120), nullable=False), sa.Column('admin',
        sa.Boolean(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.
        UniqueConstraint('email'))
    op.create_table('groups_and_users', sa.Column('user_id', sa.Integer(),
        nullable=False), sa.Column('group_id', sa.Integer(), nullable=False
        ), sa.Column('group_admin', sa.Boolean(), nullable=True), sa.
        ForeignKeyConstraint(['group_id'], ['groups.id']), sa.
        ForeignKeyConstraint(['user_id'], ['users.id']), sa.
        PrimaryKeyConstraint('user_id', 'group_id'))
    op.create_table('pairs', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('timestamp', sa.Date(), nullable=True), sa.Column(
        'group_id', sa.Integer(), nullable=True), sa.Column('giver_id', sa.
        Integer(), nullable=True), sa.Column('receiver_id', sa.Integer(),
        nullable=True), sa.ForeignKeyConstraint(['giver_id'], ['users.id']),
        sa.ForeignKeyConstraint(['group_id'], ['groups.id']), sa.
        ForeignKeyConstraint(['receiver_id'], ['users.id']), sa.
        PrimaryKeyConstraint('id'))


def downgrade():
    op.drop_table('pairs')
    op.drop_table('groups_and_users')
    op.drop_table('users')
    op.drop_table('groups')

<mask token>
from alembic import op
import sqlalchemy as sa
revision = 'd0c52114eb3d'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('groups', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('name', sa.String(length=200), nullable=False), sa.
        PrimaryKeyConstraint('id'), sa.UniqueConstraint('name'))
    op.create_table('users', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('username', sa.String(length=20), nullable=False), sa.
        Column('first_name', sa.String(length=20), nullable=True), sa.
        Column('last_name', sa.String(length=20), nullable=True), sa.Column
        ('password', sa.String(length=100), nullable=False), sa.Column(
        'email', sa.String(length=120), nullable=False), sa.Column('admin',
        sa.Boolean(), nullable=True), sa.PrimaryKeyConstraint('id'), sa.
        UniqueConstraint('email'))
    op.create_table('groups_and_users', sa.Column('user_id', sa.Integer(),
        nullable=False), sa.Column('group_id', sa.Integer(), nullable=False
        ), sa.Column('group_admin', sa.Boolean(), nullable=True), sa.
        ForeignKeyConstraint(['group_id'], ['groups.id']), sa.
        ForeignKeyConstraint(['user_id'], ['users.id']), sa.
        PrimaryKeyConstraint('user_id', 'group_id'))
    op.create_table('pairs', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('timestamp', sa.Date(), nullable=True), sa.Column(
        'group_id', sa.Integer(), nullable=True), sa.Column('giver_id', sa.
        Integer(), nullable=True), sa.Column('receiver_id', sa.Integer(),
        nullable=True), sa.ForeignKeyConstraint(['giver_id'], ['users.id']),
        sa.ForeignKeyConstraint(['group_id'], ['groups.id']), sa.
        ForeignKeyConstraint(['receiver_id'], ['users.id']), sa.
        PrimaryKeyConstraint('id'))


def downgrade():
    op.drop_table('pairs')
    op.drop_table('groups_and_users')
    op.drop_table('users')
    op.drop_table('groups')

"""empty message

Revision ID: d0c52114eb3d
Revises: 
Create Date: 2020-10-17 15:31:26.104508

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'd0c52114eb3d'
down_revision = None
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('groups',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=200), nullable=False),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('users',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.String(length=20), nullable=False),
    sa.Column('first_name', sa.String(length=20), nullable=True),
    sa.Column('last_name', sa.String(length=20), nullable=True),
    sa.Column('password', sa.String(length=100), nullable=False),
    sa.Column('email', sa.String(length=120), nullable=False),
    sa.Column('admin', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('email')
    )
    op.create_table('groups_and_users',
    sa.Column('user_id', sa.Integer(), nullable=False),
    sa.Column('group_id', sa.Integer(), nullable=False),
    sa.Column('group_admin', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['group_id'], ['groups.id'], ),
    sa.ForeignKeyConstraint(['user_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('user_id', 'group_id')
    )
    op.create_table('pairs',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('timestamp', sa.Date(), nullable=True),
    sa.Column('group_id', sa.Integer(), nullable=True),
    sa.Column('giver_id', sa.Integer(), nullable=True),
    sa.Column('receiver_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['giver_id'], ['users.id'], ),
    sa.ForeignKeyConstraint(['group_id'], ['groups.id'], ),
    sa.ForeignKeyConstraint(['receiver_id'], ['users.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('pairs')
    op.drop_table('groups_and_users')
    op.drop_table('users')
    op.drop_table('groups')
    # ### end Alembic commands ###
