ec4a35aa58ec_airtanah.py 2.79 KB
"""airtanah

Revision ID: ec4a35aa58ec
Revises: 9f9e131f2dd5
Create Date: 2023-05-19 16:42:39.550791

"""

# revision identifiers, used by Alembic.
revision = 'ec4a35aa58ec'
down_revision = '9f9e131f2dd5'
branch_labels = None
depends_on = None

from alembic import op
import sqlalchemy as sa


def upgrade():
    schema = 'pad'
    context = op.get_context()
    helpers = context.opts['helpers']
    if not helpers.table_has_column('pad_customer_usaha', 'air_kualitas_id', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('air_kualitas_id', sa.Integer), schema=schema)
    
    if not helpers.table_has_column('pad_customer_usaha', 'air_sumber_id', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('air_sumber_id', sa.Integer), schema=schema)
    
    if not helpers.table_has_column('pad_customer_usaha', 'air_jenis_sumber_id', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('air_jenis_sumber_id', sa.Integer), schema=schema)
    
    if not helpers.table_has_column('pad_customer_usaha', 'volume', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('volume', sa.Float), schema=schema)
    
    if not helpers.table_has_column('pad_customer_usaha', 'volume_progresif', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('volume_progresif', sa.String(50)), schema=schema)
        
    if not helpers.table_has_column('pad_customer_usaha', 'volume_progresif_val', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('volume_progresif_val', sa.Integer), schema=schema)
    
    if not helpers.table_has_column('pad_customer_usaha', 'indeks_kp', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('indeks_kp', sa.Float), schema=schema)
    
    if not helpers.table_has_column('pad_customer_usaha', 'kp', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kp', sa.Float), schema=schema)
        
    if not helpers.table_has_column('pad_customer_usaha', 'fna', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('fna', sa.Float), schema=schema)
    
    if not helpers.table_has_column('pad_customer_usaha', 'hab', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('hab', sa.Float), schema=schema)
        
    if not helpers.table_has_column('pad_customer_usaha', 'hda', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('hda', sa.Integer), schema=schema)
    
    if not helpers.table_has_column('pad_customer_usaha', 'npa', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('npa', sa.Float), schema=schema)


def downgrade():
    pass