"""empty message

Revision ID: f8bde734a04a
Revises: 9e4ae3a4fd38
Create Date: 2018-10-22 11:39:20.881036

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f8bde734a04a'
down_revision = '9e4ae3a4fd38'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('coupon',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('biz_id', sa.Integer(), nullable=True),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('validity_period', sa.Integer(), nullable=True),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('switch', sa.Boolean(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('modified_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_coupon_biz_id'), 'coupon', ['biz_id'], unique=False)
    op.create_table('coupon_report',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('customer_id', sa.Integer(), nullable=True),
    sa.Column('coupon_id', sa.Integer(), nullable=False),
    sa.Column('salesman_id', sa.Integer(), nullable=True),
    sa.Column('expire_at', sa.DateTime(), nullable=False),
    sa.Column('is_used', sa.Boolean(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('modified_at', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['coupon_id'], ['coupon.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_coupon_report_coupon_id'), 'coupon_report', ['coupon_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_customer_id'), 'coupon_report', ['customer_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_salesman_id'), 'coupon_report', ['salesman_id'], unique=False)
    op.add_column('customer', sa.Column('belong_salesman_id', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_customer_belong_salesman_id'), 'customer', ['belong_salesman_id'], unique=False)
    op.add_column('salesman', sa.Column('is_official', sa.Boolean(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('salesman', 'is_official')
    op.drop_index(op.f('ix_customer_belong_salesman_id'), table_name='customer')
    op.drop_column('customer', 'belong_salesman_id')
    op.drop_index(op.f('ix_coupon_report_salesman_id'), table_name='coupon_report')
    op.drop_index(op.f('ix_coupon_report_customer_id'), table_name='coupon_report')
    op.drop_index(op.f('ix_coupon_report_coupon_id'), table_name='coupon_report')
    op.drop_table('coupon_report')
    op.drop_index(op.f('ix_coupon_biz_id'), table_name='coupon')
    op.drop_table('coupon')
    # ### end Alembic commands ###

dbc7347bf2a1d1f1beb8fb7a99979be7363b5a62
<mask token>


def upgrade():
    op.create_table('coupon', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('biz_id', sa.Integer(), nullable=True), sa.Column('name',
        sa.String(), nullable=True), sa.Column('validity_period', sa.
        Integer(), nullable=True), sa.Column('description', sa.String(),
        nullable=True), sa.Column('switch', sa.Boolean(), nullable=True),
        sa.Column('created_at', sa.DateTime(), nullable=False), sa.Column(
        'modified_at', sa.DateTime(), nullable=True), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_coupon_biz_id'), 'coupon', ['biz_id'], unique=
        False)
    op.create_table('coupon_report', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('customer_id', sa.Integer(), nullable=True), sa.
        Column('coupon_id', sa.Integer(), nullable=False), sa.Column(
        'salesman_id', sa.Integer(), nullable=True), sa.Column('expire_at',
        sa.DateTime(), nullable=False), sa.Column('is_used', sa.Boolean(),
        nullable=True), sa.Column('created_at', sa.DateTime(), nullable=
        False), sa.Column('modified_at', sa.DateTime(), nullable=True), sa.
        ForeignKeyConstraint(['coupon_id'], ['coupon.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_coupon_report_coupon_id'), 'coupon_report', [
        'coupon_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_customer_id'), 'coupon_report',
        ['customer_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_salesman_id'), 'coupon_report',
        ['salesman_id'], unique=False)
    op.add_column('customer', sa.Column('belong_salesman_id', sa.Integer(),
        nullable=True))
    op.create_index(op.f('ix_customer_belong_salesman_id'), 'customer', [
        'belong_salesman_id'], unique=False)
    op.add_column('salesman', sa.Column('is_official', sa.Boolean(),
        nullable=True))


<mask token>

<mask token>


def upgrade():
    op.create_table('coupon', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('biz_id', sa.Integer(), nullable=True), sa.Column('name',
        sa.String(), nullable=True), sa.Column('validity_period', sa.
        Integer(), nullable=True), sa.Column('description', sa.String(),
        nullable=True), sa.Column('switch', sa.Boolean(), nullable=True),
        sa.Column('created_at', sa.DateTime(), nullable=False), sa.Column(
        'modified_at', sa.DateTime(), nullable=True), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_coupon_biz_id'), 'coupon', ['biz_id'], unique=
        False)
    op.create_table('coupon_report', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('customer_id', sa.Integer(), nullable=True), sa.
        Column('coupon_id', sa.Integer(), nullable=False), sa.Column(
        'salesman_id', sa.Integer(), nullable=True), sa.Column('expire_at',
        sa.DateTime(), nullable=False), sa.Column('is_used', sa.Boolean(),
        nullable=True), sa.Column('created_at', sa.DateTime(), nullable=
        False), sa.Column('modified_at', sa.DateTime(), nullable=True), sa.
        ForeignKeyConstraint(['coupon_id'], ['coupon.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_coupon_report_coupon_id'), 'coupon_report', [
        'coupon_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_customer_id'), 'coupon_report',
        ['customer_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_salesman_id'), 'coupon_report',
        ['salesman_id'], unique=False)
    op.add_column('customer', sa.Column('belong_salesman_id', sa.Integer(),
        nullable=True))
    op.create_index(op.f('ix_customer_belong_salesman_id'), 'customer', [
        'belong_salesman_id'], unique=False)
    op.add_column('salesman', sa.Column('is_official', sa.Boolean(),
        nullable=True))


def downgrade():
    op.drop_column('salesman', 'is_official')
    op.drop_index(op.f('ix_customer_belong_salesman_id'), table_name='customer'
        )
    op.drop_column('customer', 'belong_salesman_id')
    op.drop_index(op.f('ix_coupon_report_salesman_id'), table_name=
        'coupon_report')
    op.drop_index(op.f('ix_coupon_report_customer_id'), table_name=
        'coupon_report')
    op.drop_index(op.f('ix_coupon_report_coupon_id'), table_name=
        'coupon_report')
    op.drop_table('coupon_report')
    op.drop_index(op.f('ix_coupon_biz_id'), table_name='coupon')
    op.drop_table('coupon')

<mask token>
revision = 'f8bde734a04a'
down_revision = '9e4ae3a4fd38'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('coupon', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('biz_id', sa.Integer(), nullable=True), sa.Column('name',
        sa.String(), nullable=True), sa.Column('validity_period', sa.
        Integer(), nullable=True), sa.Column('description', sa.String(),
        nullable=True), sa.Column('switch', sa.Boolean(), nullable=True),
        sa.Column('created_at', sa.DateTime(), nullable=False), sa.Column(
        'modified_at', sa.DateTime(), nullable=True), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_coupon_biz_id'), 'coupon', ['biz_id'], unique=
        False)
    op.create_table('coupon_report', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('customer_id', sa.Integer(), nullable=True), sa.
        Column('coupon_id', sa.Integer(), nullable=False), sa.Column(
        'salesman_id', sa.Integer(), nullable=True), sa.Column('expire_at',
        sa.DateTime(), nullable=False), sa.Column('is_used', sa.Boolean(),
        nullable=True), sa.Column('created_at', sa.DateTime(), nullable=
        False), sa.Column('modified_at', sa.DateTime(), nullable=True), sa.
        ForeignKeyConstraint(['coupon_id'], ['coupon.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_coupon_report_coupon_id'), 'coupon_report', [
        'coupon_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_customer_id'), 'coupon_report',
        ['customer_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_salesman_id'), 'coupon_report',
        ['salesman_id'], unique=False)
    op.add_column('customer', sa.Column('belong_salesman_id', sa.Integer(),
        nullable=True))
    op.create_index(op.f('ix_customer_belong_salesman_id'), 'customer', [
        'belong_salesman_id'], unique=False)
    op.add_column('salesman', sa.Column('is_official', sa.Boolean(),
        nullable=True))


def downgrade():
    op.drop_column('salesman', 'is_official')
    op.drop_index(op.f('ix_customer_belong_salesman_id'), table_name='customer'
        )
    op.drop_column('customer', 'belong_salesman_id')
    op.drop_index(op.f('ix_coupon_report_salesman_id'), table_name=
        'coupon_report')
    op.drop_index(op.f('ix_coupon_report_customer_id'), table_name=
        'coupon_report')
    op.drop_index(op.f('ix_coupon_report_coupon_id'), table_name=
        'coupon_report')
    op.drop_table('coupon_report')
    op.drop_index(op.f('ix_coupon_biz_id'), table_name='coupon')
    op.drop_table('coupon')

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


def upgrade():
    op.create_table('coupon', sa.Column('id', sa.Integer(), nullable=False),
        sa.Column('biz_id', sa.Integer(), nullable=True), sa.Column('name',
        sa.String(), nullable=True), sa.Column('validity_period', sa.
        Integer(), nullable=True), sa.Column('description', sa.String(),
        nullable=True), sa.Column('switch', sa.Boolean(), nullable=True),
        sa.Column('created_at', sa.DateTime(), nullable=False), sa.Column(
        'modified_at', sa.DateTime(), nullable=True), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_coupon_biz_id'), 'coupon', ['biz_id'], unique=
        False)
    op.create_table('coupon_report', sa.Column('id', sa.Integer(), nullable
        =False), sa.Column('customer_id', sa.Integer(), nullable=True), sa.
        Column('coupon_id', sa.Integer(), nullable=False), sa.Column(
        'salesman_id', sa.Integer(), nullable=True), sa.Column('expire_at',
        sa.DateTime(), nullable=False), sa.Column('is_used', sa.Boolean(),
        nullable=True), sa.Column('created_at', sa.DateTime(), nullable=
        False), sa.Column('modified_at', sa.DateTime(), nullable=True), sa.
        ForeignKeyConstraint(['coupon_id'], ['coupon.id']), sa.
        PrimaryKeyConstraint('id'))
    op.create_index(op.f('ix_coupon_report_coupon_id'), 'coupon_report', [
        'coupon_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_customer_id'), 'coupon_report',
        ['customer_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_salesman_id'), 'coupon_report',
        ['salesman_id'], unique=False)
    op.add_column('customer', sa.Column('belong_salesman_id', sa.Integer(),
        nullable=True))
    op.create_index(op.f('ix_customer_belong_salesman_id'), 'customer', [
        'belong_salesman_id'], unique=False)
    op.add_column('salesman', sa.Column('is_official', sa.Boolean(),
        nullable=True))


def downgrade():
    op.drop_column('salesman', 'is_official')
    op.drop_index(op.f('ix_customer_belong_salesman_id'), table_name='customer'
        )
    op.drop_column('customer', 'belong_salesman_id')
    op.drop_index(op.f('ix_coupon_report_salesman_id'), table_name=
        'coupon_report')
    op.drop_index(op.f('ix_coupon_report_customer_id'), table_name=
        'coupon_report')
    op.drop_index(op.f('ix_coupon_report_coupon_id'), table_name=
        'coupon_report')
    op.drop_table('coupon_report')
    op.drop_index(op.f('ix_coupon_biz_id'), table_name='coupon')
    op.drop_table('coupon')

"""empty message

Revision ID: f8bde734a04a
Revises: 9e4ae3a4fd38
Create Date: 2018-10-22 11:39:20.881036

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = 'f8bde734a04a'
down_revision = '9e4ae3a4fd38'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('coupon',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('biz_id', sa.Integer(), nullable=True),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('validity_period', sa.Integer(), nullable=True),
    sa.Column('description', sa.String(), nullable=True),
    sa.Column('switch', sa.Boolean(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('modified_at', sa.DateTime(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_coupon_biz_id'), 'coupon', ['biz_id'], unique=False)
    op.create_table('coupon_report',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('customer_id', sa.Integer(), nullable=True),
    sa.Column('coupon_id', sa.Integer(), nullable=False),
    sa.Column('salesman_id', sa.Integer(), nullable=True),
    sa.Column('expire_at', sa.DateTime(), nullable=False),
    sa.Column('is_used', sa.Boolean(), nullable=True),
    sa.Column('created_at', sa.DateTime(), nullable=False),
    sa.Column('modified_at', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['coupon_id'], ['coupon.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_coupon_report_coupon_id'), 'coupon_report', ['coupon_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_customer_id'), 'coupon_report', ['customer_id'], unique=False)
    op.create_index(op.f('ix_coupon_report_salesman_id'), 'coupon_report', ['salesman_id'], unique=False)
    op.add_column('customer', sa.Column('belong_salesman_id', sa.Integer(), nullable=True))
    op.create_index(op.f('ix_customer_belong_salesman_id'), 'customer', ['belong_salesman_id'], unique=False)
    op.add_column('salesman', sa.Column('is_official', sa.Boolean(), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('salesman', 'is_official')
    op.drop_index(op.f('ix_customer_belong_salesman_id'), table_name='customer')
    op.drop_column('customer', 'belong_salesman_id')
    op.drop_index(op.f('ix_coupon_report_salesman_id'), table_name='coupon_report')
    op.drop_index(op.f('ix_coupon_report_customer_id'), table_name='coupon_report')
    op.drop_index(op.f('ix_coupon_report_coupon_id'), table_name='coupon_report')
    op.drop_table('coupon_report')
    op.drop_index(op.f('ix_coupon_biz_id'), table_name='coupon')
    op.drop_table('coupon')
    # ### end Alembic commands ###
