40 lines
1.8 KiB
Python
40 lines
1.8 KiB
Python
"""fix nullability
|
|
|
|
Revision ID: f135019a4ebf
|
|
Revises: 0e326930b8a4
|
|
Create Date: 2023-02-22 03:41:23.537388
|
|
|
|
"""
|
|
import sqlalchemy as sa
|
|
|
|
from alembic import op
|
|
|
|
|
|
# revision identifiers, used by Alembic.
|
|
revision = "f135019a4ebf"
|
|
down_revision = "0e326930b8a4"
|
|
branch_labels = None
|
|
depends_on = None
|
|
|
|
|
|
def upgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.alter_column("inventories", "quantity", existing_type=sa.NUMERIC(precision=15, scale=2), nullable=False)
|
|
op.alter_column("inventories", "price", existing_type=sa.NUMERIC(precision=15, scale=2), nullable=False)
|
|
op.alter_column("inventories", "tax_rate", existing_type=sa.NUMERIC(precision=15, scale=5), nullable=False)
|
|
op.alter_column("inventories", "discount", existing_type=sa.NUMERIC(precision=15, scale=5), nullable=False)
|
|
op.alter_column("permissions", "name", existing_type=sa.VARCHAR(length=255), nullable=False)
|
|
op.alter_column("roles", "name", existing_type=sa.VARCHAR(length=255), nullable=False)
|
|
# ### end Alembic commands ###
|
|
|
|
|
|
def downgrade():
|
|
# ### commands auto generated by Alembic - please adjust! ###
|
|
op.alter_column("roles", "name", existing_type=sa.VARCHAR(length=255), nullable=True)
|
|
op.alter_column("permissions", "name", existing_type=sa.VARCHAR(length=255), nullable=True)
|
|
op.alter_column("inventories", "discount", existing_type=sa.NUMERIC(precision=15, scale=5), nullable=True)
|
|
op.alter_column("inventories", "tax_rate", existing_type=sa.NUMERIC(precision=15, scale=5), nullable=True)
|
|
op.alter_column("inventories", "price", existing_type=sa.NUMERIC(precision=15, scale=2), nullable=True)
|
|
op.alter_column("inventories", "quantity", existing_type=sa.NUMERIC(precision=15, scale=2), nullable=True)
|
|
# ### end Alembic commands ###
|