|
10 | 10 |
|
11 | 11 |
|
12 | 12 | # revision identifiers, used by Alembic. |
13 | | -revision = '99f3dec93615' |
14 | | -down_revision = '9f927a8e4679' |
| 13 | +revision = "99f3dec93615" |
| 14 | +down_revision = "9f927a8e4679" |
15 | 15 | branch_labels = None |
16 | 16 | depends_on = None |
17 | 17 |
|
18 | 18 |
|
19 | 19 | def upgrade(): |
20 | 20 | # ### commands auto generated by Alembic - please adjust! ### |
21 | | - op.create_table('workflow_incident_priority', |
22 | | - sa.Column('incident_priority_id', sa.Integer(), nullable=False), |
23 | | - sa.Column('workflow_id', sa.Integer(), nullable=False), |
24 | | - sa.ForeignKeyConstraint(['incident_priority_id'], ['incident_priority.id'], ), |
25 | | - sa.ForeignKeyConstraint(['workflow_id'], ['workflow.id'], ), |
26 | | - sa.PrimaryKeyConstraint('incident_priority_id', 'workflow_id') |
| 21 | + op.create_table( |
| 22 | + "workflow_incident_priority", |
| 23 | + sa.Column("incident_priority_id", sa.Integer(), nullable=False), |
| 24 | + sa.Column("workflow_id", sa.Integer(), nullable=False), |
| 25 | + sa.ForeignKeyConstraint( |
| 26 | + ["incident_priority_id"], |
| 27 | + ["incident_priority.id"], |
| 28 | + ), |
| 29 | + sa.ForeignKeyConstraint( |
| 30 | + ["workflow_id"], |
| 31 | + ["workflow.id"], |
| 32 | + ), |
| 33 | + sa.PrimaryKeyConstraint("incident_priority_id", "workflow_id"), |
27 | 34 | ) |
28 | | - op.create_table('workflow_incident_type', |
29 | | - sa.Column('incident_type_id', sa.Integer(), nullable=False), |
30 | | - sa.Column('workflow_id', sa.Integer(), nullable=False), |
31 | | - sa.ForeignKeyConstraint(['incident_type_id'], ['incident_type.id'], ), |
32 | | - sa.ForeignKeyConstraint(['workflow_id'], ['workflow.id'], ), |
33 | | - sa.PrimaryKeyConstraint('incident_type_id', 'workflow_id') |
| 35 | + op.create_table( |
| 36 | + "workflow_incident_type", |
| 37 | + sa.Column("incident_type_id", sa.Integer(), nullable=False), |
| 38 | + sa.Column("workflow_id", sa.Integer(), nullable=False), |
| 39 | + sa.ForeignKeyConstraint( |
| 40 | + ["incident_type_id"], |
| 41 | + ["incident_type.id"], |
| 42 | + ), |
| 43 | + sa.ForeignKeyConstraint( |
| 44 | + ["workflow_id"], |
| 45 | + ["workflow.id"], |
| 46 | + ), |
| 47 | + sa.PrimaryKeyConstraint("incident_type_id", "workflow_id"), |
34 | 48 | ) |
35 | | - op.create_table('workflow_term', |
36 | | - sa.Column('term_id', sa.Integer(), nullable=False), |
37 | | - sa.Column('workflow_id', sa.Integer(), nullable=False), |
38 | | - sa.ForeignKeyConstraint(['term_id'], ['term.id'], ), |
39 | | - sa.ForeignKeyConstraint(['workflow_id'], ['workflow.id'], ), |
40 | | - sa.PrimaryKeyConstraint('term_id', 'workflow_id') |
| 49 | + op.create_table( |
| 50 | + "workflow_term", |
| 51 | + sa.Column("term_id", sa.Integer(), nullable=False), |
| 52 | + sa.Column("workflow_id", sa.Integer(), nullable=False), |
| 53 | + sa.ForeignKeyConstraint( |
| 54 | + ["term_id"], |
| 55 | + ["term.id"], |
| 56 | + ), |
| 57 | + sa.ForeignKeyConstraint( |
| 58 | + ["workflow_id"], |
| 59 | + ["workflow.id"], |
| 60 | + ), |
| 61 | + sa.PrimaryKeyConstraint("term_id", "workflow_id"), |
41 | 62 | ) |
42 | | - op.create_table('workflow_instance_artifact', |
43 | | - sa.Column('document_id', sa.Integer(), nullable=False), |
44 | | - sa.Column('workflow_instance_id', sa.Integer(), nullable=False), |
45 | | - sa.ForeignKeyConstraint(['document_id'], ['document.id'], ), |
46 | | - sa.ForeignKeyConstraint(['workflow_instance_id'], ['workflow_instance.id'], ), |
47 | | - sa.PrimaryKeyConstraint('document_id', 'workflow_instance_id') |
| 63 | + op.create_table( |
| 64 | + "workflow_instance_artifact", |
| 65 | + sa.Column("document_id", sa.Integer(), nullable=False), |
| 66 | + sa.Column("workflow_instance_id", sa.Integer(), nullable=False), |
| 67 | + sa.ForeignKeyConstraint( |
| 68 | + ["document_id"], |
| 69 | + ["document.id"], |
| 70 | + ), |
| 71 | + sa.ForeignKeyConstraint( |
| 72 | + ["workflow_instance_id"], |
| 73 | + ["workflow_instance.id"], |
| 74 | + ), |
| 75 | + sa.PrimaryKeyConstraint("document_id", "workflow_instance_id"), |
48 | 76 | ) |
49 | | - op.drop_table('workflow_instance_artifacts') |
| 77 | + op.drop_table("workflow_instance_artifacts") |
50 | 78 | # ### end Alembic commands ### |
51 | 79 |
|
52 | 80 |
|
53 | 81 | def downgrade(): |
54 | 82 | # ### commands auto generated by Alembic - please adjust! ### |
55 | | - op.create_table('workflow_instance_artifacts', |
56 | | - sa.Column('document_id', sa.INTEGER(), autoincrement=False, nullable=False), |
57 | | - sa.Column('workflow_instance_id', sa.INTEGER(), autoincrement=False, nullable=False), |
58 | | - sa.ForeignKeyConstraint(['document_id'], ['document.id'], name='workflow_instance_artifacts_document_id_fkey'), |
59 | | - sa.ForeignKeyConstraint(['workflow_instance_id'], ['workflow_instance.id'], name='workflow_instance_artifacts_workflow_instance_id_fkey'), |
60 | | - sa.PrimaryKeyConstraint('document_id', 'workflow_instance_id', name='workflow_instance_artifacts_pkey') |
| 83 | + op.create_table( |
| 84 | + "workflow_instance_artifacts", |
| 85 | + sa.Column("document_id", sa.INTEGER(), autoincrement=False, nullable=False), |
| 86 | + sa.Column("workflow_instance_id", sa.INTEGER(), autoincrement=False, nullable=False), |
| 87 | + sa.ForeignKeyConstraint( |
| 88 | + ["document_id"], ["document.id"], name="workflow_instance_artifacts_document_id_fkey" |
| 89 | + ), |
| 90 | + sa.ForeignKeyConstraint( |
| 91 | + ["workflow_instance_id"], |
| 92 | + ["workflow_instance.id"], |
| 93 | + name="workflow_instance_artifacts_workflow_instance_id_fkey", |
| 94 | + ), |
| 95 | + sa.PrimaryKeyConstraint( |
| 96 | + "document_id", "workflow_instance_id", name="workflow_instance_artifacts_pkey" |
| 97 | + ), |
61 | 98 | ) |
62 | | - op.drop_table('workflow_instance_artifact') |
63 | | - op.drop_table('workflow_term') |
64 | | - op.drop_table('workflow_incident_type') |
65 | | - op.drop_table('workflow_incident_priority') |
| 99 | + op.drop_table("workflow_instance_artifact") |
| 100 | + op.drop_table("workflow_term") |
| 101 | + op.drop_table("workflow_incident_type") |
| 102 | + op.drop_table("workflow_incident_priority") |
66 | 103 | # ### end Alembic commands ### |
0 commit comments