"""move task fields to gantt

Revision ID: ba0c0c03e023
Revises: d19f3d1adeb7
Create Date: 2023-03-02 14:45:54.734588

"""
from alembic import op
import sqlalchemy as sa


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


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_column('cmf_chat_group', 'time_estimate')
    op.drop_column('cmf_chat_topic', 'time_estimate')
    op.drop_column('cmf_company', 'time_estimate')
    op.drop_column('cmf_dashboard', 'time_estimate')
    op.drop_column('cmf_deal', 'time_estimate')
    op.drop_column('cmf_document', 'time_estimate')
    op.drop_column('cmf_folder', 'time_estimate')
    op.drop_column('cmf_import', 'time_estimate')
    op.drop_column('cmf_invoice', 'time_estimate')
    op.drop_column('cmf_kanban_board', 'time_estimate')
    op.drop_column('cmf_lead', 'time_estimate')
    op.drop_column('cmf_list', 'time_estimate')
    op.drop_column('cmf_mail', 'time_estimate')
    op.drop_column('cmf_payment', 'time_estimate')
    op.drop_column('cmf_pipeline', 'time_estimate')
    op.drop_column('cmf_project', 'time_estimate')
    op.drop_column('cmf_purchase_order', 'time_estimate')
    op.drop_column('cmf_purchase_order_items', 'time_estimate')
    op.drop_column('cmf_roadmap', 'time_estimate')
    op.drop_column('cmf_scheme_wf', 'time_estimate')
    op.drop_column('cmf_stock_incoming_order', 'time_estimate')
    op.drop_column('cmf_stock_initial', 'time_estimate')
    op.drop_column('cmf_stock_inventory', 'time_estimate')
    op.drop_column('cmf_stock_move', 'time_estimate')
    op.drop_column('cmf_stock_outcoming_order', 'time_estimate')
    op.add_column('cmf_task', sa.Column('estimate_work', sa.Integer(), nullable=True))
    op.drop_column('cmf_task', 'time_spent')
    op.drop_column('cmf_task', 'time_estimate')
    op.drop_column('cmf_task', 'remaining_estimate')
    op.drop_column('cmf_task_filter', 'time_estimate')
    op.drop_column('cmf_task_report', 'time_estimate')
    op.drop_column('cmf_u_work_post', 'time_estimate')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('cmf_u_work_post', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_task_report', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_task_filter', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_task', sa.Column('remaining_estimate', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=False))
    op.add_column('cmf_task', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_task', sa.Column('time_spent', sa.INTEGER(), server_default=sa.text('0'), autoincrement=False, nullable=False))
    op.drop_column('cmf_task', 'estimate_work')
    op.add_column('cmf_stock_outcoming_order', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_stock_move', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_stock_inventory', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_stock_initial', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_stock_incoming_order', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_scheme_wf', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_roadmap', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_purchase_order_items', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_purchase_order', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_project', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_pipeline', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_payment', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_mail', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_list', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_lead', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_kanban_board', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_invoice', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_import', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_folder', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_document', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_deal', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_dashboard', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_company', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_chat_topic', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    op.add_column('cmf_chat_group', sa.Column('time_estimate', sa.INTEGER(), autoincrement=False, nullable=True))
    # ### end Alembic commands ###
