"""CryptoFiatRates

Revision ID: ba8d7e2257df
Revises: 
Create Date: 2021-03-11 14:10:35.833511

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

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('crypto_fiat_rates',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('crypto_symbol', sa.VARCHAR(length=100), nullable=False),
    sa.Column('fiat_symbol', sa.VARCHAR(length=100), nullable=False),
    sa.Column('crypto_rate', sa.DECIMAL(precision=19, scale=8), nullable=False),
    sa.Column('fiat_rate', sa.DECIMAL(precision=19, scale=8), nullable=False),
    sa.Column('from_date', mysql.TIMESTAMP(), nullable=False),
    sa.Column('to_date', mysql.TIMESTAMP(), nullable=True),
    sa.Column('created_at', mysql.TIMESTAMP(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_table('historical_crypto_fiat_exhange_rates',
    sa.Column('id', sa.Integer(), autoincrement=True, nullable=False),
    sa.Column('crypto_symbol', sa.VARCHAR(length=100), nullable=False),
    sa.Column('fiat_symbol', sa.VARCHAR(length=100), nullable=False),
    sa.Column('crypto_rate', sa.DECIMAL(precision=19, scale=8), nullable=False),
    sa.Column('fiat_rate', sa.DECIMAL(precision=19, scale=8), nullable=False),
    sa.Column('created_at', mysql.TIMESTAMP(), nullable=True),
    sa.PrimaryKeyConstraint('id')
    )
    op.create_index(op.f('ix_historical_crypto_fiat_exhange_rates_created_at'), 'historical_crypto_fiat_exhange_rates', ['created_at'], unique=False)
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f('ix_historical_crypto_fiat_exhange_rates_created_at'), table_name='historical_crypto_fiat_exhange_rates')
    op.drop_table('historical_crypto_fiat_exhange_rates')
    op.drop_table('crypto_fiat_rates')
    # ### end Alembic commands ###
