"""empty message

Revision ID: 9d2cc3010c3c
Revises: a60851e7652d
Create Date: 2021-05-21 18:09:17.753012

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = '9d2cc3010c3c'
down_revision = 'a60851e7652d'
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table('Assets',
    sa.Column('assetid', sa.Integer(), nullable=False),
    sa.Column('assetname', sa.String(length=100), nullable=True),
    sa.Column('category', sa.String(length=100), nullable=True),
    sa.Column('make', sa.String(length=100), nullable=True),
    sa.Column('model', sa.String(length=100), nullable=True),
    sa.Column('serialno', sa.String(length=100), nullable=True),
    sa.Column('location', sa.String(length=100), nullable=True),
    sa.Column('intallationdate', sa.DateTime(), nullable=True),
    sa.Column('assetcode', sa.String(length=100), nullable=True),
    sa.Column('status', sa.String(length=100), nullable=True),
    sa.Column('statuschangedate', sa.DateTime(), nullable=True),
    sa.Column('categoryid', sa.Integer(), nullable=True),
    sa.Column('locationid', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('assetid')
    )
    op.create_table('Category',
    sa.Column('categoryid', sa.Integer(), nullable=False),
    sa.Column('categoryname', sa.String(length=100), nullable=True),
    sa.Column('parentid', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('categoryid')
    )
    op.create_table('Fuelgate',
    sa.Column('fuelid', sa.Integer(), nullable=False),
    sa.Column('vehicleno', sa.String(length=100), nullable=True),
    sa.Column('slipno', sa.String(length=100), nullable=True),
    sa.Column('challanno', sa.String(length=100), nullable=True),
    sa.Column('quantity', sa.Integer(), nullable=True),
    sa.Column('fueltime', sa.DateTime(), nullable=True),
    sa.Column('vehicleid', sa.Integer(), nullable=True),
    sa.Column('fuelslipno', sa.String(length=100), nullable=True),
    sa.Column('username', sa.String(length=100), nullable=True),
    sa.Column('slipid', sa.Integer(), nullable=True),
    sa.Column('transporter', sa.String(length=100), nullable=True),
    sa.Column('transporterid', sa.Integer(), nullable=True),
    sa.Column('location', sa.String(length=100), nullable=True),
    sa.Column('locationid', sa.Integer(), nullable=True),
    sa.Column('wheeler', sa.Integer(), nullable=True),
    sa.Column('driver', sa.String(length=100), nullable=True),
    sa.Column('driverid', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('fuelid')
    )
    op.create_table('Outgate',
    sa.Column('challanid', sa.Integer(), nullable=False),
    sa.Column('slipno', sa.String(length=100), nullable=True),
    sa.Column('slipid', sa.Integer(), nullable=True),
    sa.Column('vehicleno', sa.String(length=100), nullable=True),
    sa.Column('driver', sa.String(length=100), nullable=True),
    sa.Column('driverid', sa.Integer(), nullable=True),
    sa.Column('loading', sa.String(length=100), nullable=True),
    sa.Column('destination', sa.String(length=100), nullable=True),
    sa.Column('challanno', sa.String(length=100), nullable=True),
    sa.Column('gross', sa.Integer(), nullable=True),
    sa.Column('tare', sa.Integer(), nullable=True),
    sa.Column('net', sa.Integer(), nullable=True),
    sa.Column('passdate', sa.DateTime(), nullable=True),
    sa.Column('passgate', sa.String(length=50), nullable=True),
    sa.Column('sliptime', sa.DateTime(), nullable=True),
    sa.Column('challantime', sa.DateTime(), nullable=True),
    sa.Column('printtime', sa.DateTime(), nullable=True),
    sa.Column('material', sa.String(length=50), nullable=True),
    sa.Column('weightbridge', sa.String(length=50), nullable=True),
    sa.Column('vehicleid', sa.Integer(), nullable=True),
    sa.Column('locationid', sa.Integer(), nullable=True),
    sa.Column('username', sa.String(length=50), nullable=True),
    sa.Column('tranporterid', sa.Integer(), nullable=True),
    sa.Column('transporter', sa.String(length=50), nullable=True),
    sa.Column('challannet', sa.Integer(), nullable=True),
    sa.Column('grosswbid', sa.Integer(), nullable=True),
    sa.Column('grosswb', sa.String(length=50), nullable=True),
    sa.Column('tarewbid', sa.Integer(), nullable=True),
    sa.Column('tarewb', sa.String(length=50), nullable=True),
    sa.PrimaryKeyConstraint('challanid')
    )
    op.create_table('Rfidtag',
    sa.Column('rfid', sa.Integer(), nullable=False),
    sa.Column('rfno', sa.String(length=100), nullable=True),
    sa.Column('isactive', sa.Boolean(create_constraint=100), nullable=True),
    sa.Column('issuedate', sa.DateTime(), nullable=True),
    sa.Column('vehicleno', sa.String(length=4), nullable=True),
    sa.Column('vehicleid', sa.Integer(), nullable=True),
    sa.PrimaryKeyConstraint('rfid')
    )
    op.create_table('UserPermissions',
    sa.Column('userpermissionid', sa.Integer(), nullable=False),
    sa.Column('userid', sa.Integer(), nullable=False),
    sa.Column('permissionkey', sa.String(length=100), nullable=True),
    sa.Column('granted', sa.Boolean(), server_default='True', nullable=False),
    sa.PrimaryKeyConstraint('userpermissionid')
    )
    op.drop_column('vehicles', 'vownership')
    op.drop_column('vehicles', 'vowner')
    op.drop_column('vehicles', 'vcontact')
    op.drop_column('vehicles', 'vaddress')
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.add_column('vehicles', sa.Column('vaddress', sa.VARCHAR(length=50), nullable=True))
    op.add_column('vehicles', sa.Column('vcontact', sa.VARCHAR(length=50), nullable=True))
    op.add_column('vehicles', sa.Column('vowner', sa.VARCHAR(length=50), nullable=True))
    op.add_column('vehicles', sa.Column('vownership', sa.BOOLEAN(), server_default=sa.text("'false'"), nullable=True))
    op.drop_table('UserPermissions')
    op.drop_table('Rfidtag')
    op.drop_table('Outgate')
    op.drop_table('Fuelgate')
    op.drop_table('Category')
    op.drop_table('Assets')
    # ### end Alembic commands ###
