"""add_equipment

Revision ID: 78eeaa194828
Revises: b738ba262419
Create Date: 2022-01-14 09:12:26.367868

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "78eeaa194828"
down_revision = "b738ba262419"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "equipment_types",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=100), nullable=False),
        sa.Column("pathImg", sa.String(length=100), nullable=True),
        sa.Column("price", sa.Numeric(precision=5, scale=2), nullable=True),
        sa.Column("deposit", sa.Numeric(precision=5, scale=2), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "equipment_models",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=100), nullable=False),
        sa.Column("equipment_type_id", sa.Integer(), nullable=True),
        sa.Column("manufacturer", sa.String(length=50), nullable=True),
        sa.ForeignKeyConstraint(
            ["equipment_type_id"],
            ["equipment_types.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "equipments",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("reference", sa.String(length=100), nullable=False),
        sa.Column("purchaseDate", sa.DateTime(), nullable=False),
        sa.Column("purchasePrice", sa.Numeric(precision=8, scale=2), nullable=True),
        sa.Column("serial_number", sa.String(length=50), nullable=True),
        sa.Column(
            "status",
            sa.Enum(
                "Available", "Rented", "Unavailable", "InReview", name="equipmentstatus"
            ),
            nullable=False,
        ),
        sa.Column("equipment_model_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["equipment_model_id"],
            ["equipment_models.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("reference"),
    )
    op.create_index(
        op.f("ix_equipments_purchaseDate"), "equipments", ["purchaseDate"], unique=False
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_equipments_purchaseDate"), table_name="equipments")
    op.drop_table("equipments")
    op.drop_table("equipment_models")
    op.drop_table("equipment_types")
    # ### end Alembic commands ###

c6a90b931cbe179a11e7fcfd6e459ae488a8e594
<mask token>

<mask token>


def upgrade():
    op.create_table('equipment_types', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('name', sa.String(length=100), nullable=
        False), sa.Column('pathImg', sa.String(length=100), nullable=True),
        sa.Column('price', sa.Numeric(precision=5, scale=2), nullable=True),
        sa.Column('deposit', sa.Numeric(precision=5, scale=2), nullable=
        True), sa.PrimaryKeyConstraint('id'))
    op.create_table('equipment_models', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('name', sa.String(length=100), nullable=
        False), sa.Column('equipment_type_id', sa.Integer(), nullable=True),
        sa.Column('manufacturer', sa.String(length=50), nullable=True), sa.
        ForeignKeyConstraint(['equipment_type_id'], ['equipment_types.id']),
        sa.PrimaryKeyConstraint('id'))
    op.create_table('equipments', sa.Column('id', sa.Integer(), nullable=
        False), sa.Column('reference', sa.String(length=100), nullable=
        False), sa.Column('purchaseDate', sa.DateTime(), nullable=False),
        sa.Column('purchasePrice', sa.Numeric(precision=8, scale=2),
        nullable=True), sa.Column('serial_number', sa.String(length=50),
        nullable=True), sa.Column('status', sa.Enum('Available', 'Rented',
        'Unavailable', 'InReview', name='equipmentstatus'), nullable=False),
        sa.Column('equipment_model_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['equipment_model_id'], ['equipment_models.id'
        ]), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('reference'))
    op.create_index(op.f('ix_equipments_purchaseDate'), 'equipments', [
        'purchaseDate'], unique=False)


def downgrade():
    op.drop_index(op.f('ix_equipments_purchaseDate'), table_name='equipments')
    op.drop_table('equipments')
    op.drop_table('equipment_models')
    op.drop_table('equipment_types')

<mask token>
revision = '78eeaa194828'
down_revision = 'b738ba262419'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('equipment_types', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('name', sa.String(length=100), nullable=
        False), sa.Column('pathImg', sa.String(length=100), nullable=True),
        sa.Column('price', sa.Numeric(precision=5, scale=2), nullable=True),
        sa.Column('deposit', sa.Numeric(precision=5, scale=2), nullable=
        True), sa.PrimaryKeyConstraint('id'))
    op.create_table('equipment_models', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('name', sa.String(length=100), nullable=
        False), sa.Column('equipment_type_id', sa.Integer(), nullable=True),
        sa.Column('manufacturer', sa.String(length=50), nullable=True), sa.
        ForeignKeyConstraint(['equipment_type_id'], ['equipment_types.id']),
        sa.PrimaryKeyConstraint('id'))
    op.create_table('equipments', sa.Column('id', sa.Integer(), nullable=
        False), sa.Column('reference', sa.String(length=100), nullable=
        False), sa.Column('purchaseDate', sa.DateTime(), nullable=False),
        sa.Column('purchasePrice', sa.Numeric(precision=8, scale=2),
        nullable=True), sa.Column('serial_number', sa.String(length=50),
        nullable=True), sa.Column('status', sa.Enum('Available', 'Rented',
        'Unavailable', 'InReview', name='equipmentstatus'), nullable=False),
        sa.Column('equipment_model_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['equipment_model_id'], ['equipment_models.id'
        ]), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('reference'))
    op.create_index(op.f('ix_equipments_purchaseDate'), 'equipments', [
        'purchaseDate'], unique=False)


def downgrade():
    op.drop_index(op.f('ix_equipments_purchaseDate'), table_name='equipments')
    op.drop_table('equipments')
    op.drop_table('equipment_models')
    op.drop_table('equipment_types')

<mask token>
from alembic import op
import sqlalchemy as sa
revision = '78eeaa194828'
down_revision = 'b738ba262419'
branch_labels = None
depends_on = None


def upgrade():
    op.create_table('equipment_types', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('name', sa.String(length=100), nullable=
        False), sa.Column('pathImg', sa.String(length=100), nullable=True),
        sa.Column('price', sa.Numeric(precision=5, scale=2), nullable=True),
        sa.Column('deposit', sa.Numeric(precision=5, scale=2), nullable=
        True), sa.PrimaryKeyConstraint('id'))
    op.create_table('equipment_models', sa.Column('id', sa.Integer(),
        nullable=False), sa.Column('name', sa.String(length=100), nullable=
        False), sa.Column('equipment_type_id', sa.Integer(), nullable=True),
        sa.Column('manufacturer', sa.String(length=50), nullable=True), sa.
        ForeignKeyConstraint(['equipment_type_id'], ['equipment_types.id']),
        sa.PrimaryKeyConstraint('id'))
    op.create_table('equipments', sa.Column('id', sa.Integer(), nullable=
        False), sa.Column('reference', sa.String(length=100), nullable=
        False), sa.Column('purchaseDate', sa.DateTime(), nullable=False),
        sa.Column('purchasePrice', sa.Numeric(precision=8, scale=2),
        nullable=True), sa.Column('serial_number', sa.String(length=50),
        nullable=True), sa.Column('status', sa.Enum('Available', 'Rented',
        'Unavailable', 'InReview', name='equipmentstatus'), nullable=False),
        sa.Column('equipment_model_id', sa.Integer(), nullable=True), sa.
        ForeignKeyConstraint(['equipment_model_id'], ['equipment_models.id'
        ]), sa.PrimaryKeyConstraint('id'), sa.UniqueConstraint('reference'))
    op.create_index(op.f('ix_equipments_purchaseDate'), 'equipments', [
        'purchaseDate'], unique=False)


def downgrade():
    op.drop_index(op.f('ix_equipments_purchaseDate'), table_name='equipments')
    op.drop_table('equipments')
    op.drop_table('equipment_models')
    op.drop_table('equipment_types')

"""add_equipment

Revision ID: 78eeaa194828
Revises: b738ba262419
Create Date: 2022-01-14 09:12:26.367868

"""
from alembic import op
import sqlalchemy as sa


# revision identifiers, used by Alembic.
revision = "78eeaa194828"
down_revision = "b738ba262419"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.create_table(
        "equipment_types",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=100), nullable=False),
        sa.Column("pathImg", sa.String(length=100), nullable=True),
        sa.Column("price", sa.Numeric(precision=5, scale=2), nullable=True),
        sa.Column("deposit", sa.Numeric(precision=5, scale=2), nullable=True),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "equipment_models",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("name", sa.String(length=100), nullable=False),
        sa.Column("equipment_type_id", sa.Integer(), nullable=True),
        sa.Column("manufacturer", sa.String(length=50), nullable=True),
        sa.ForeignKeyConstraint(
            ["equipment_type_id"],
            ["equipment_types.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
    )
    op.create_table(
        "equipments",
        sa.Column("id", sa.Integer(), nullable=False),
        sa.Column("reference", sa.String(length=100), nullable=False),
        sa.Column("purchaseDate", sa.DateTime(), nullable=False),
        sa.Column("purchasePrice", sa.Numeric(precision=8, scale=2), nullable=True),
        sa.Column("serial_number", sa.String(length=50), nullable=True),
        sa.Column(
            "status",
            sa.Enum(
                "Available", "Rented", "Unavailable", "InReview", name="equipmentstatus"
            ),
            nullable=False,
        ),
        sa.Column("equipment_model_id", sa.Integer(), nullable=True),
        sa.ForeignKeyConstraint(
            ["equipment_model_id"],
            ["equipment_models.id"],
        ),
        sa.PrimaryKeyConstraint("id"),
        sa.UniqueConstraint("reference"),
    )
    op.create_index(
        op.f("ix_equipments_purchaseDate"), "equipments", ["purchaseDate"], unique=False
    )
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    op.drop_index(op.f("ix_equipments_purchaseDate"), table_name="equipments")
    op.drop_table("equipments")
    op.drop_table("equipment_models")
    op.drop_table("equipment_types")
    # ### end Alembic commands ###
