brewman/brewman/alembic/versions/002f51d87565_precision.py

292 lines
7.1 KiB
Python

"""precision
Revision ID: 002f51d87565
Revises: eed0b382c287
Create Date: 2020-11-03 20:54:33.718750
"""
import sqlalchemy as sa
from alembic import op
# revision identifiers, used by Alembic.
revision = "002f51d87565"
down_revision = "eed0b382c287"
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"products",
"fraction",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=5),
existing_nullable=False,
)
op.alter_column(
"products",
"product_yield",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=5),
existing_nullable=False,
)
op.alter_column(
"products",
"cost_price",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
existing_nullable=False,
)
op.alter_column(
"products",
"sale_price",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
existing_nullable=False,
)
op.alter_column(
"recipes",
"quantity",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
existing_nullable=False,
)
op.alter_column(
"recipes",
"cost_price",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
existing_nullable=False,
)
op.alter_column(
"recipes",
"sale_price",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
existing_nullable=False,
)
op.alter_column(
"journals",
"debit",
existing_type=sa.Integer(),
nullable=False,
)
op.alter_column(
"journals",
"amount",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
nullable=False,
)
op.alter_column(
"inventories",
"quantity",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
nullable=False,
)
op.alter_column(
"inventories",
"rate",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
nullable=False,
)
op.alter_column(
"inventories",
"tax",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=5),
nullable=False,
)
op.alter_column(
"inventories",
"discount",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=5),
nullable=False,
)
op.alter_column(
"batches",
"quantity_remaining",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
nullable=False,
)
op.alter_column(
"batches",
"rate",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=2),
nullable=False,
)
op.alter_column(
"batches",
"tax",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=5),
nullable=False,
)
op.alter_column(
"batches",
"discount",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=15, scale=5),
nullable=False,
)
op.alter_column(
"attendances",
"amount",
existing_type=sa.Numeric(),
type_=sa.Numeric(precision=5, scale=2),
existing_nullable=False,
)
op.alter_column(
"incentives",
"days_worked",
existing_type=sa.INTEGER(),
type_=sa.Numeric(precision=5, scale=1),
existing_nullable=False,
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.alter_column(
"products",
"fraction",
existing_type=sa.Numeric(precision=15, scale=5),
type_=sa.Numeric(),
existing_nullable=False,
)
op.alter_column(
"products",
"product_yield",
existing_type=sa.Numeric(precision=15, scale=5),
type_=sa.Numeric(),
existing_nullable=False,
)
op.alter_column(
"products",
"cost_price",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
existing_nullable=False,
)
op.alter_column(
"products",
"sale_price",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
existing_nullable=False,
)
op.alter_column(
"recipes",
"quantity",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
existing_nullable=False,
)
op.alter_column(
"recipes",
"cost_price",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
existing_nullable=False,
)
op.alter_column(
"recipes",
"sale_price",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
existing_nullable=False,
)
op.alter_column(
"journals",
"debit",
existing_type=sa.Integer(),
nullable=True,
)
op.alter_column(
"journals",
"amount",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
nullable=True,
)
op.alter_column(
"inventories",
"quantity",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
nullable=True,
)
op.alter_column(
"inventories",
"rate",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
nullable=True,
)
op.alter_column(
"inventories",
"tax",
existing_type=sa.Numeric(precision=15, scale=5),
type_=sa.Numeric(),
nullable=True,
)
op.alter_column(
"inventories",
"discount",
existing_type=sa.Numeric(precision=15, scale=5),
type_=sa.Numeric(),
nullable=True,
)
op.alter_column(
"batches",
"quantity_remaining",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
nullable=True,
)
op.alter_column(
"batches",
"rate",
existing_type=sa.Numeric(precision=15, scale=2),
type_=sa.Numeric(),
nullable=True,
)
op.alter_column(
"batches",
"tax",
existing_type=sa.Numeric(precision=15, scale=5),
type_=sa.Numeric(),
nullable=True,
)
op.alter_column(
"batches",
"discount",
existing_type=sa.Numeric(precision=15, scale=5),
type_=sa.Numeric(),
nullable=True,
)
op.alter_column(
"attendances",
"amount",
existing_type=sa.Numeric(precision=5, scale=2),
type_=sa.Numeric(),
existing_nullable=False,
)
op.alter_column(
"incentives",
"days_worked",
existing_type=sa.Numeric(precision=5, scale=1),
type_=sa.INTEGER(),
existing_nullable=False,
)
# ### end Alembic commands ###