180ade8e2494_penambahan_field_rincian_objek.py 3.95 KB
"""Penambahan field rincian objek

Revision ID: 180ade8e2494
Revises: a52365776f0c
Create Date: 2023-03-13 17:41:59.001147

"""

# revision identifiers, used by Alembic.
import sqlalchemy as sa
from alembic import op
revision = '180ade8e2494'
down_revision = 'a52365776f0c'
branch_labels = None
depends_on = None


def upgrade():
    schema = 'pad'
    context = op.get_context()
    helpers = context.opts['helpers']
#      kd_restojmlmeja | integer | | |
#  kd_restojmlkursi     | integer                     |           |          |
#  kd_restojmltamu      | integer                     |           |          |
#  kd_filmkursi         | integer                     |           |          |
#  kd_filmpertunjukan   | integer                     |           |          |
#  kd_filmtarif         | double precision            |           |          |
#  kd_bilyarmeja        | integer                     |           |          |
#  kd_bilyartarif       | double precision            |           |          |
#  kd_bilyarkegiatan    | integer                     |           |          |
#  kd_diskopengunjung   | integer                     |           |          |
#  kd_diskotarif        | double precision            |           |          |
#  kd_waletvolume       | integer

    if not helpers.table_has_column('pad_customer_usaha', 'kd_restojmlmeja', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_restojmlmeja', sa.Integer), schema=schema)

    if not helpers.table_has_column('pad_customer_usaha', 'kd_restojmlkursi', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_restojmlkursi', sa.Integer), schema=schema)

    if not helpers.table_has_column('pad_customer_usaha', 'kd_restojmltamu', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_restojmltamu', sa.Integer), schema=schema)
    if not helpers.table_has_column('pad_customer_usaha', 'jml_pegawai', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('jml_pegawai', sa.Integer), schema=schema)
    if not helpers.table_has_column('pad_customer_usaha', 'kd_filmkursi', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_filmkursi', sa.Integer), schema=schema)
    if not helpers.table_has_column('pad_customer_usaha', 'kd_filmpertunjukan', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_filmpertunjukan', sa.Integer), schema=schema)
        
    if not helpers.table_has_column('pad_customer_usaha', 'kd_filmtarif', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_filmtarif', sa.Float), schema=schema)
        
    if not helpers.table_has_column('pad_customer_usaha', 'kd_bilyarmeja', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_bilyarmeja', sa.Integer), schema=schema)
        
    if not helpers.table_has_column('pad_customer_usaha', 'kd_bilyartarif', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_bilyartarif', sa.Float), schema=schema)
    if not helpers.table_has_column('pad_customer_usaha', 'kd_bilyarkegiatan', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_bilyarkegiatan', sa.Integer), schema=schema)
    if not helpers.table_has_column('pad_customer_usaha', 'kd_diskopengunjung', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_diskopengunjung', sa.Integer), schema=schema)
    if not helpers.table_has_column('pad_customer_usaha', 'kd_diskotarif', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_diskotarif', sa.Float), schema=schema)
    if not helpers.table_has_column('pad_customer_usaha', 'kd_waletvolume', schema):
        op.add_column('pad_customer_usaha',
                      sa.Column('kd_waletvolume', sa.Integer), schema=schema)
        

def downgrade():
    pass