"""empty message

Revision ID: 27c0fff58193
Revises: 
Create Date: 2019-02-02 16:06:49.372395

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('user',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('type', sa.String(length=20), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('content',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('type', sa.String(length=20), nullable=True),
    sa.Column('data', sa.Text(convert_unicode=True), nullable=True),
    sa.Column('date_created', sa.DateTime(), nullable=True),
    sa.Column('date_modified', sa.DateTime(), nullable=True),
    sa.Column('author_id', sa.Integer(), nullable=True),
    sa.ForeignKeyConstraint(['author_id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('guest',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.Unicode(length=64), nullable=True),
    sa.Column('last_post', sa.DateTime(), nullable=True),
    sa.ForeignKeyConstraint(['id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_guest_username'), 'guest', ['username'], unique=False)
    op.create_table('member',
    sa.Column('id', sa.Integer(), nullable=False),
    sa.Column('username', sa.Unicode(length=64), nullable=True),
    sa.Column('email', sa.String(length=120), nullable=True),
    sa.Column('password_hash', sa.String(length=255), nullable=True),
    sa.Column('xp_points', sa.Integer(), nullable=True),
    sa.Column('innovation_points', sa.Integer(), nullable=True),
    sa.Column('biography', sa.Text(convert_unicode=True), nullable=True),
    sa.Column('signature', sa.Text(convert_unicode=True), nullable=True),
    sa.Column('birthday', sa.Date(), nullable=True),
    sa.Column('register_date', sa.Date(), nullable=True),
    sa.Column('receive_newsletter', sa.Boolean(), nullable=True),
    sa.ForeignKeyConstraint(['id'], ['user.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_member_email'), 'member', ['email'], unique=True)
    op.create_index(op.f('ix_member_username'), 'member', ['username'], unique=True)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_member_username'), table_name='member')
    op.drop_index(op.f('ix_member_email'), table_name='member')
    op.drop_table('member')
    op.drop_index(op.f('ix_guest_username'), table_name='guest')
    op.drop_table('guest')
    op.drop_table('content')
    op.drop_table('user')
    # ### end Alembic commands ###
