"""empty message

Revision ID: 4ae3e7ff6869
Revises: None
Create Date: 2019-09-15 13:00:50.459886

"""

# revision identifiers, used by Alembic.
revision = '4ae3e7ff6869'
down_revision = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('customer',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name', sa.String(length=64), nullable=False),
    sa.Column('about', sa.String(), nullable=False),
    sa.Column('phone', sa.String(length=12), nullable=True),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('anketa',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('about', sa.Text(), nullable=False),
    sa.Column('price', sa.Float(), nullable=False),
    sa.Column('status', sa.String(length=64), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('phonenumber', sa.String(length=20), nullable=True),
    sa.Column('rating', sa.Float(), nullable=False),
    sa.Column('customer_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['customer_id'], ['customer.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('tariff',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name_tariff', sa.String(), nullable=False),
    sa.Column('tariff_price', sa.Float(), nullable=False),
    sa.Column('tariff_base', sa.Float(), nullable=False),
    sa.Column('tariff_status', sa.String(), nullable=False),
    sa.Column('customer_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['customer_id'], ['customer.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('calls',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('anketa_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['anketa_id'], ['anketa.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('categories_sex',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('name_category', sa.String(), nullable=False),
    sa.Column('anketa_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['anketa_id'], ['anketa.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('na_vyezd',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('type', sa.String(), nullable=False),
    sa.Column('anketa_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['anketa_id'], ['anketa.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('otzyvy',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('otzyv', sa.Text(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('seen', sa.Boolean(), nullable=False),
    sa.Column('anketa_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['anketa_id'], ['anketa.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('photos',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('anketa_id', sa.Integer(), nullable=False),
    sa.Column('info', sa.String(), nullable=True),
    sa.Column('image', sa.String(), nullable=False),
    sa.ForeignKeyConstraint(['anketa_id'], ['anketa.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('texts',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('anketa_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['anketa_id'], ['anketa.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('views',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('created', sa.DateTime(), nullable=True),
    sa.Column('anketa_id', sa.Integer(), nullable=False),
    sa.ForeignKeyConstraint(['anketa_id'], ['anketa.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('views')
    op.drop_table('texts')
    op.drop_table('photos')
    op.drop_table('otzyvy')
    op.drop_table('na_vyezd')
    op.drop_table('categories_sex')
    op.drop_table('calls')
    op.drop_table('tariff')
    op.drop_table('anketa')
    op.drop_table('customer')
    # ### end Alembic commands ###
