4581a68fa644_submission_result.py 1.51 KB
Newer Older
Lukáš Lalinský's avatar
Lukáš Lalinský committed
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
"""submission result

Revision ID: 4581a68fa644
Revises: d52d50968cf7
Create Date: 2019-06-08 12:17:40.208947

"""
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import postgresql

# revision identifiers, used by Alembic.
revision = '4581a68fa644'
down_revision = 'd52d50968cf7'
branch_labels = None
depends_on = None


def upgrade(engine_name):
    globals()["upgrade_%s" % engine_name]()


def downgrade(engine_name):
    globals()["downgrade_%s" % engine_name]()


27
def upgrade_main():
Lukáš Lalinský's avatar
Lukáš Lalinský committed
28 29 30
    pass


31
def downgrade_main():
Lukáš Lalinský's avatar
Lukáš Lalinský committed
32 33 34
    pass


35
def upgrade_import():
Lukáš Lalinský's avatar
Lukáš Lalinský committed
36 37
    op.create_table('submission_result',
        sa.Column('submission_id', sa.Integer(), autoincrement=False, nullable=False),
38
        sa.Column('created', sa.DateTime(timezone=True), server_main=sa.text('CURRENT_TIMESTAMP'), nullable=False),
Lukáš Lalinský's avatar
Lukáš Lalinský committed
39 40 41 42 43 44 45 46 47 48 49 50 51
        sa.Column('account_id', sa.Integer(), nullable=False),
        sa.Column('application_id', sa.Integer(), nullable=False),
        sa.Column('application_version', sa.String(), nullable=True),
        sa.Column('fingerprint_id', sa.Integer(), nullable=False),
        sa.Column('track_id', sa.Integer(), nullable=False),
        sa.Column('meta_id', sa.Integer(), nullable=True),
        sa.Column('mbid', postgresql.UUID(), nullable=True),
        sa.Column('puid', postgresql.UUID(), nullable=True),
        sa.Column('foreignid', sa.String(), nullable=True),
        sa.PrimaryKeyConstraint('submission_id', name=op.f('submission_result_pkey'))
    )


52
def downgrade_import():
Lukáš Lalinský's avatar
Lukáš Lalinský committed
53
    op.drop_table('submission_result')