fae86fcfd306_upgrade_table_reklame.py
5.75 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
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
"""upgrade table reklame
Revision ID: fae86fcfd306
Revises: cc1cac32d25f
Create Date: 2023-03-31 14:50:41.452509
"""
# revision identifiers, used by Alembic.
revision = 'fae86fcfd306'
down_revision = 'cc1cac32d25f'
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_rk_nilai_lokasi', 'status_id', schema):
# op.add_column('pad_rk_nilai_lokasi',
# sa.Column('status_id', sa.Integer), schema=schema)
# if not helpers.table_has_column('pad_rk_nilai_lokasi', 'other_score', schema):
# op.add_column('pad_rk_nilai_lokasi',
# sa.Column('other_score', sa.Integer), schema=schema)
# if not helpers.table_has_column('pad_rk_nilai_kelas_jalan', 'status_id', schema):
# op.add_column('pad_rk_nilai_kelas_jalan',
# sa.Column('status_id', sa.Integer), schema=schema)
# if not helpers.table_has_column('pad_rk_nilai_kelas_jalan', 'other_score', schema):
# op.add_column('pad_rk_nilai_kelas_jalan',
# sa.Column('other_score', sa.Integer), schema=schema)
# if not helpers.table_has_column('pad_rk_nilai_sudut_pandang', 'status_id', schema):
# op.add_column('pad_rk_nilai_sudut_pandang',
# sa.Column('status_id', sa.Integer), schema=schema)
# if not helpers.table_has_column('pad_rk_nilai_sudut_pandang', 'other_score', schema):
# op.add_column('pad_rk_nilai_sudut_pandang',
# sa.Column('other_score', sa.Integer), schema=schema)
# if not helpers.table_has_column('pad_rk_ketinggian', 'status_id', schema):
# op.add_column('pad_rk_ketinggian',
# sa.Column('status_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'status_id', schema):
op.add_column('pad_customer_usaha',
sa.Column('status_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'pajak_id', schema):
op.add_column('pad_customer_usaha',
sa.Column('pajak_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'cahaya_id', schema):
op.add_column('pad_customer_usaha',
sa.Column('cahaya_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'pasang_id', schema):
op.add_column('pad_customer_usaha',
sa.Column('pasang_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'bahan', schema):
op.add_column('pad_customer_usaha',
sa.Column('bahan', sa.String(256)), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'letak_reklame_id', schema):
op.add_column('pad_customer_usaha',
sa.Column('letak_reklame_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'produk_reklame_id', schema):
op.add_column('pad_customer_usaha',
sa.Column('produk_reklame_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'sudut_pandang_id', schema):
op.add_column('pad_customer_usaha',
sa.Column('sudut_pandang_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'lokasi_id', schema):
op.add_column('pad_customer_usaha',
sa.Column('lokasi_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'kelas_jalan_id', schema):
op.add_column('pad_customer_usaha',
sa.Column('kelas_jalan_id', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'panjang', schema):
op.add_column('pad_customer_usaha',
sa.Column('panjang', sa.Float), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'lebar', schema):
op.add_column('pad_customer_usaha',
sa.Column('lebar', sa.Float), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'luas', schema):
op.add_column('pad_customer_usaha',
sa.Column('luas', sa.Float), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'tinggi', schema):
op.add_column('pad_customer_usaha',
sa.Column('tinggi', sa.Float), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'muka', schema):
op.add_column('pad_customer_usaha',
sa.Column('muka', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'banyak', schema):
op.add_column('pad_customer_usaha',
sa.Column('banyak', sa.Integer), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'njopr', schema):
op.add_column('pad_customer_usaha',
sa.Column('njopr', sa.Float), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'nspr', schema):
op.add_column('pad_customer_usaha',
sa.Column('nspr', sa.Float), schema=schema)
if not helpers.table_has_column('pad_customer_usaha', 'nsr', schema):
op.add_column('pad_customer_usaha',
sa.Column('nsr', sa.Float), schema=schema)
if not helpers.table_has_column('pad_rek_lokasi_pasang', 'lahan', schema):
op.add_column('pad_rek_lokasi_pasang',
sa.Column('lahan', sa.String(50)), schema=schema)
def downgrade():
pass