e8a60199b6a3_penambahan_field_parkir.py
3.63 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
"""Penambahan field parkir
Revision ID: e8a60199b6a3
Revises: 180ade8e2494
Create Date: 2023-03-13 20:12:37.208370
"""
# revision identifiers, used by Alembic.
revision = 'e8a60199b6a3'
down_revision = '180ade8e2494'
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', 'kd_park_roda2_luas', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda2_luas', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_roda2_jumlah', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda2_jumlah', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_roda2_tarif1', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda2_tarif1', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_roda2_tarif2', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda2_tarif2', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_roda2_tarif3', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda2_tarif3', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_roda4_luas', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda4_luas', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_roda4_jumlah', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda4_jumlah', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_roda4_tarif1', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda4_tarif1', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_roda4_tarif2', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda4_tarif2', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_roda4_tarif3', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_roda4_tarif3', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_rodax_luas', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_rodax_luas', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_rodax_jumlah', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_rodax_jumlah', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_rodax_tarif1', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_rodax_tarif1', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_rodax_tarif2', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_rodax_tarif2', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kd_park_rodax_tarif3', schema):
op.add_column('pad_customer_usaha',
sa.Column('kd_park_rodax_tarif3', sa.Integer), schema=schema)
def downgrade():
pass