10a68b1510a6_.py
5.11 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
"""empty message
Revision ID: 10a68b1510a6
Revises:
Create Date: 2026-01-19 18:41:11.619834
"""
# revision identifiers, used by Alembic.
from sqlalchemy.dialects import postgresql
import sqlalchemy as sa
from alembic import op
revision = '10a68b1510a6'
down_revision = '021a8a342d5b'
branch_labels = None
depends_on = None
def upgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.create_table('eselon',
sa.Column('pangkat', sa.String(length=32), nullable=True),
sa.Column('ruang', sa.String(length=1), nullable=True),
sa.Column('tunjangan', sa.BigInteger(), nullable=True),
sa.Column('nama', sa.String(length=128), nullable=False),
sa.Column('kode', sa.String(length=32), nullable=False),
sa.Column('status', sa.SmallInteger(), nullable=False),
sa.Column('created', sa.DateTime(), nullable=True),
sa.Column('updated', sa.DateTime(), nullable=True),
sa.Column('create_uid', sa.Integer(), nullable=True),
sa.Column('update_uid', sa.Integer(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_eselon')),
schema='public'
)
op.create_table('pangkat',
sa.Column('pangkat', sa.String(length=32), nullable=True),
sa.Column('ruang', sa.String(length=1), nullable=True),
sa.Column('nama', sa.String(length=128), nullable=False),
sa.Column('kode', sa.String(length=32), nullable=False),
sa.Column('status', sa.SmallInteger(), nullable=False),
sa.Column('created', sa.DateTime(), nullable=True),
sa.Column('updated', sa.DateTime(), nullable=True),
sa.Column('create_uid', sa.Integer(), nullable=True),
sa.Column('update_uid', sa.Integer(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.PrimaryKeyConstraint('id', name=op.f('pk_pangkat')),
schema='public'
)
op.create_table('jabatan',
sa.Column('jenis', sa.SmallInteger(), nullable=True),
sa.Column('nama_lain', sa.String(
length=128), nullable=True),
sa.Column('nama_pendek', sa.String(
length=128), nullable=True),
sa.Column('eselon_id', sa.SmallInteger(), nullable=True),
sa.Column('nama', sa.String(length=128), nullable=False),
sa.Column('kode', sa.String(length=32), nullable=False),
sa.Column('status', sa.SmallInteger(), nullable=False),
sa.Column('created', sa.DateTime(), nullable=True),
sa.Column('updated', sa.DateTime(), nullable=True),
sa.Column('create_uid', sa.Integer(), nullable=True),
sa.Column('update_uid', sa.Integer(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['eselon_id'], ['public.eselon.id'], name=op.f(
'fk_jabatan_eselon_id_eselon')),
sa.PrimaryKeyConstraint('id', name=op.f('pk_jabatan')),
schema='public'
)
op.create_table('partner_departemen',
sa.Column('partner_id', sa.Integer(), nullable=True),
sa.Column('departemen_id', sa.Integer(), nullable=True),
sa.Column('jabatan_id', sa.SmallInteger(), nullable=True),
sa.Column('mulai', sa.DateTime(), nullable=True),
sa.Column('selesai', sa.DateTime(), nullable=True),
sa.Column('id', sa.Integer(), nullable=False),
sa.ForeignKeyConstraint(['departemen_id'], ['public.departemen.id'], name=op.f(
'fk_partner_departemen_departemen_id_departemen')),
sa.ForeignKeyConstraint(['jabatan_id'], ['public.jabatan.id'], name=op.f(
'fk_partner_departemen_jabatan_id_jabatan')),
sa.ForeignKeyConstraint(['partner_id'], ['partner.id'], name=op.f(
'fk_partner_departemen_partner_id_partner')),
sa.PrimaryKeyConstraint(
'id', name=op.f('pk_partner_departemen')),
sa.UniqueConstraint('partner_id', 'departemen_id',
'jabatan_id', 'mulai', name='partner_dept_uq'),
schema='public'
)
# ### end Alembic commands ###
def downgrade():
# ### commands auto generated by Alembic - please adjust! ###
op.drop_table('partner_departemen', schema='public')
op.drop_table('jabatan', schema='public')
op.drop_table('pangkat', schema='public')
op.drop_table('eselon', schema='public')
# ### end Alembic commands ###