"""Initial state

Revision ID: da4dcbacbe0e
Revises: 
Create Date: 2017-11-26 07:28:44.449869

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

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('person',
    sa.Column('id', postgresql.UUID(), nullable=False),
    sa.Column('name', sa.String(), nullable=True),
    sa.Column('phone_number', sa.String(length=15), nullable=True),
    sa.Column('admin', sa.Boolean(), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    sa.UniqueConstraint('name')
    )
    op.create_table('iou',
    sa.Column('id', postgresql.UUID(), nullable=False),
    sa.Column('ower_id', postgresql.UUID(), nullable=False),
    sa.Column('owee_id', postgresql.UUID(), nullable=False),
    sa.Column('amount', sa.Float(), nullable=True),
    sa.Column('date_added', sa.DateTime(timezone=True), nullable=True),
    sa.ForeignKeyConstraint(['owee_id'], ['person.id'], ),
    sa.ForeignKeyConstraint(['ower_id'], ['person.id'], ),
    sa.PrimaryKeyConstraint('id')
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('iou')
    op.drop_table('person')
    # ### end Alembic commands ###
