"""Adding column ex_date to daily_stock_data.

Revision ID: 63c962ea0422
Revises: 
Create Date: 2021-06-03 14:35:30.262401

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

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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_table('data')
    op.add_column('daily_stock_data', sa.Column('ex_date', sa.String(length=100), nullable=True))
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('daily_stock_data', 'ex_date')
    op.create_table('data',
    sa.Column('id', mysql.INTEGER(display_width=11), autoincrement=True, nullable=False),
    sa.Column('company_name', mysql.VARCHAR(length=200), nullable=True),
    sa.Column('symbol', mysql.VARCHAR(length=100), nullable=True),
    sa.Column('country', mysql.VARCHAR(length=100), nullable=True),
    sa.Column('previous_close', mysql.VARCHAR(length=100), nullable=True),
    sa.Column('open', mysql.VARCHAR(length=100), nullable=True),
    sa.Column('high', mysql.VARCHAR(length=100), nullable=True),
    sa.Column('low', mysql.VARCHAR(length=100), nullable=True),
    sa.Column('close', mysql.VARCHAR(length=100), nullable=True),
    sa.PrimaryKeyConstraint('id'),
    mysql_default_charset='latin1',
    mysql_engine='InnoDB'
    )
    # ### end Alembic commands ###
