|
- """Fix
-
- Revision ID: a92339978636
- Revises: 95369c9d99cc
- Create Date: 2023-09-04 16:03:42.207089
-
- """
- from typing import Sequence, Union
-
- from alembic import op
- import sqlalchemy as sa
-
-
- # revision identifiers, used by Alembic.
- revision: str = 'a92339978636'
- down_revision: Union[str, None] = '95369c9d99cc'
- branch_labels: Union[str, Sequence[str], None] = None
- depends_on: Union[str, Sequence[str], None] = None
-
-
- def upgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- op.create_table('vehicle',
- sa.Column('Id', sa.Integer(), nullable=False),
- sa.Column('Model', sa.String(), nullable=False),
- sa.Column('Year', sa.Integer(), nullable=False),
- sa.Column('LicensePlate', sa.String(), nullable=False),
- sa.Column('CurrentLocation', sa.ARRAY(sa.String()), nullable=True),
- sa.Column('Fuel', sa.Integer(), nullable=False),
- sa.Column('Mileage', sa.Integer(), nullable=False),
- sa.Column('Status', sa.String(), nullable=False),
- sa.Column('Capacity', sa.Integer(), nullable=False),
- sa.Column('MaintenanceNotes', sa.ARRAY(sa.String()), nullable=True),
- sa.PrimaryKeyConstraint('Id')
- )
- op.create_index(op.f('ix_vehicle_Id'), 'vehicle', ['Id'], unique=False)
- op.create_table('user',
- sa.Column('Id', sa.Integer(), nullable=False),
- sa.Column('Name', sa.String(), nullable=False),
- sa.Column('MiddleName', sa.String(), nullable=True),
- sa.Column('LastName', sa.String(), nullable=False),
- sa.Column('BirthDate', sa.DateTime(), nullable=False),
- sa.Column('ContactNumber', sa.String(), nullable=False),
- sa.Column('Email', sa.String(), nullable=False),
- sa.Column('Role', sa.String(), nullable=False),
- sa.Column('DrivingLicenseNumber', sa.String(), nullable=True),
- sa.Column('AssignedVehicle', sa.Integer(), nullable=True),
- sa.Column('HashedPassword', sa.String(), nullable=False),
- sa.ForeignKeyConstraint(['AssignedVehicle'], ['vehicle.Id'], ),
- sa.PrimaryKeyConstraint('Id')
- )
- op.create_index(op.f('ix_user_Id'), 'user', ['Id'], unique=False)
- # ### end Alembic commands ###
-
-
- def downgrade() -> None:
- # ### commands auto generated by Alembic - please adjust! ###
- op.drop_index(op.f('ix_user_Id'), table_name='user')
- op.drop_table('user')
- op.drop_index(op.f('ix_vehicle_Id'), table_name='vehicle')
- op.drop_table('vehicle')
- # ### end Alembic commands ###
|