"""Master inherit Client

Revision ID: 4178da311d37
Revises: 3cfada6ad5d7
Create Date: 2020-04-30 08:41:18.013234

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '4178da311d37'
down_revision = '3cfada6ad5d7'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('master_phone_key', 'master', type_='unique')
    op.create_foreign_key(None, 'master', 'client', ['id'], ['id'], onupdate='RESTRICT', ondelete='RESTRICT')
    op.drop_column('master', 'email')
    op.drop_column('master', 'first_name')
    op.drop_column('master', 'photo')
    op.drop_column('master', 'surname')
    op.drop_column('master', 'phone')
    op.drop_column('master', 'second_name')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('master', sa.Column('second_name', sa.VARCHAR(length=20), autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('phone', sa.VARCHAR(length=10), autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('surname', sa.VARCHAR(length=20), autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('photo', postgresql.BYTEA(), autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('first_name', sa.VARCHAR(length=20), autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('email', sa.VARCHAR(length=30), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'master', type_='foreignkey')
    op.create_unique_constraint('master_phone_key', 'master', ['phone'])
    # ### end Alembic commands ###

1bb4119803d5a43d0df21e7ba27337c6c1e775ed
<mask token>


def upgrade():
    op.drop_constraint('master_phone_key', 'master', type_='unique')
    op.create_foreign_key(None, 'master', 'client', ['id'], ['id'],
        onupdate='RESTRICT', ondelete='RESTRICT')
    op.drop_column('master', 'email')
    op.drop_column('master', 'first_name')
    op.drop_column('master', 'photo')
    op.drop_column('master', 'surname')
    op.drop_column('master', 'phone')
    op.drop_column('master', 'second_name')


<mask token>

<mask token>


def upgrade():
    op.drop_constraint('master_phone_key', 'master', type_='unique')
    op.create_foreign_key(None, 'master', 'client', ['id'], ['id'],
        onupdate='RESTRICT', ondelete='RESTRICT')
    op.drop_column('master', 'email')
    op.drop_column('master', 'first_name')
    op.drop_column('master', 'photo')
    op.drop_column('master', 'surname')
    op.drop_column('master', 'phone')
    op.drop_column('master', 'second_name')


def downgrade():
    op.add_column('master', sa.Column('second_name', sa.VARCHAR(length=20),
        autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('phone', sa.VARCHAR(length=10),
        autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('surname', sa.VARCHAR(length=20),
        autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('photo', postgresql.BYTEA(),
        autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('first_name', sa.VARCHAR(length=20),
        autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('email', sa.VARCHAR(length=30),
        autoincrement=False, nullable=True))
    op.drop_constraint(None, 'master', type_='foreignkey')
    op.create_unique_constraint('master_phone_key', 'master', ['phone'])

<mask token>
revision = '4178da311d37'
down_revision = '3cfada6ad5d7'
branch_labels = None
depends_on = None


def upgrade():
    op.drop_constraint('master_phone_key', 'master', type_='unique')
    op.create_foreign_key(None, 'master', 'client', ['id'], ['id'],
        onupdate='RESTRICT', ondelete='RESTRICT')
    op.drop_column('master', 'email')
    op.drop_column('master', 'first_name')
    op.drop_column('master', 'photo')
    op.drop_column('master', 'surname')
    op.drop_column('master', 'phone')
    op.drop_column('master', 'second_name')


def downgrade():
    op.add_column('master', sa.Column('second_name', sa.VARCHAR(length=20),
        autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('phone', sa.VARCHAR(length=10),
        autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('surname', sa.VARCHAR(length=20),
        autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('photo', postgresql.BYTEA(),
        autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('first_name', sa.VARCHAR(length=20),
        autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('email', sa.VARCHAR(length=30),
        autoincrement=False, nullable=True))
    op.drop_constraint(None, 'master', type_='foreignkey')
    op.create_unique_constraint('master_phone_key', 'master', ['phone'])

<mask token>
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql
revision = '4178da311d37'
down_revision = '3cfada6ad5d7'
branch_labels = None
depends_on = None


def upgrade():
    op.drop_constraint('master_phone_key', 'master', type_='unique')
    op.create_foreign_key(None, 'master', 'client', ['id'], ['id'],
        onupdate='RESTRICT', ondelete='RESTRICT')
    op.drop_column('master', 'email')
    op.drop_column('master', 'first_name')
    op.drop_column('master', 'photo')
    op.drop_column('master', 'surname')
    op.drop_column('master', 'phone')
    op.drop_column('master', 'second_name')


def downgrade():
    op.add_column('master', sa.Column('second_name', sa.VARCHAR(length=20),
        autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('phone', sa.VARCHAR(length=10),
        autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('surname', sa.VARCHAR(length=20),
        autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('photo', postgresql.BYTEA(),
        autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('first_name', sa.VARCHAR(length=20),
        autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('email', sa.VARCHAR(length=30),
        autoincrement=False, nullable=True))
    op.drop_constraint(None, 'master', type_='foreignkey')
    op.create_unique_constraint('master_phone_key', 'master', ['phone'])

"""Master inherit Client

Revision ID: 4178da311d37
Revises: 3cfada6ad5d7
Create Date: 2020-04-30 08:41:18.013234

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '4178da311d37'
down_revision = '3cfada6ad5d7'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_constraint('master_phone_key', 'master', type_='unique')
    op.create_foreign_key(None, 'master', 'client', ['id'], ['id'], onupdate='RESTRICT', ondelete='RESTRICT')
    op.drop_column('master', 'email')
    op.drop_column('master', 'first_name')
    op.drop_column('master', 'photo')
    op.drop_column('master', 'surname')
    op.drop_column('master', 'phone')
    op.drop_column('master', 'second_name')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('master', sa.Column('second_name', sa.VARCHAR(length=20), autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('phone', sa.VARCHAR(length=10), autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('surname', sa.VARCHAR(length=20), autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('photo', postgresql.BYTEA(), autoincrement=False, nullable=True))
    op.add_column('master', sa.Column('first_name', sa.VARCHAR(length=20), autoincrement=False, nullable=False))
    op.add_column('master', sa.Column('email', sa.VARCHAR(length=30), autoincrement=False, nullable=True))
    op.drop_constraint(None, 'master', type_='foreignkey')
    op.create_unique_constraint('master_phone_key', 'master', ['phone'])
    # ### end Alembic commands ###
