"""currencies table

Revision ID: f4648b40694c
Revises: 
Create Date: 2019-09-02 10:23:34.831134

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('currencies',
    sa.Column('vid', sa.String(length=16), nullable=False),
    sa.Column('name', sa.String(length=32), nullable=True),
    sa.PrimaryKeyConstraint('vid'),
    sa.UniqueConstraint('name'),
    sa.UniqueConstraint('vid')
    )
    op.create_table('rates',
    sa.Column('fvid', sa.Integer(), nullable=False),
    sa.Column('date', sa.Date(), nullable=False),
    sa.Column('value', sa.Float(), nullable=True),
    sa.ForeignKeyConstraint(['fvid'], ['currencies.vid'], ),
    sa.PrimaryKeyConstraint('fvid', 'date')
    )
    # ### end Alembic commands ###


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