File: 35c79626ecb9_fix_some_columns.py

package info (click to toggle)
python-pyfunceble 4.2.29.dev-1
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 4,108 kB
  • sloc: python: 27,413; sh: 142; makefile: 27
file content (78 lines) | stat: -rw-r--r-- 1,807 bytes parent folder | download
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
"""Fix some columns

Revision ID: 35c79626ecb9
Revises: ade87195b0a0
Create Date: 2020-08-21 11:42:07.044762

"""

from alembic import op
from sqlalchemy.exc import OperationalError

# pylint: skip-file

# revision identifiers, used by Alembic.
revision = "35c79626ecb9"
down_revision = "ade87195b0a0"
branch_labels = None
depends_on = None


def upgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    try:
        op.create_index(
            op.f("ix_pyfunceble_mined_mined"),
            "pyfunceble_mined",
            ["mined"],
            unique=False,
        )
    except OperationalError:
        pass

    try:
        op.drop_index("mined", table_name="pyfunceble_mined")
    except OperationalError:
        pass

    try:
        op.create_index(
            op.f("ix_pyfunceble_status_tested"),
            "pyfunceble_status",
            ["tested"],
            unique=False,
        )
    except OperationalError:
        pass

    try:
        op.drop_index("tested", table_name="pyfunceble_status")
    except OperationalError:
        pass
    # ### end Alembic commands ###


def downgrade():
    # ### commands auto generated by Alembic - please adjust! ###
    try:
        op.create_index("tested", "pyfunceble_status", ["tested"], unique=True)
    except OperationalError:
        pass

    try:
        op.drop_index(
            op.f("ix_pyfunceble_status_tested"), table_name="pyfunceble_status"
        )
    except OperationalError:
        pass

    try:
        op.create_index("mined", "pyfunceble_mined", ["mined"], unique=True)
    except OperationalError:
        pass

    try:
        op.drop_index(op.f("ix_pyfunceble_mined_mined"), table_name="pyfunceble_mined")
    except OperationalError:
        pass
    # ### end Alembic commands ###