| Total Complexity | 4 |
| Total Lines | 25 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | """unique concept.id + conceptscheme.id |
||
| 2 | |||
| 3 | Revision ID: 79ff53a30228 |
||
| 4 | Revises: 3e9675b35dfc |
||
| 5 | Create Date: 2020-09-14 12:23:22.546226 |
||
| 6 | |||
| 7 | """ |
||
| 8 | from alembic import op |
||
| 9 | |||
| 10 | # revision identifiers, used by Alembic. |
||
| 11 | revision = "79ff53a30228" |
||
| 12 | down_revision = "3e9675b35dfc" |
||
| 13 | |||
| 14 | |||
| 15 | def upgrade(): |
||
| 16 | with op.batch_alter_table("concept") as batch_op: |
||
| 17 | batch_op.create_unique_constraint( |
||
| 18 | "uq_concept_concept_id_conceptscheme_id", ["concept_id", "conceptscheme_id"] |
||
| 19 | ) |
||
| 20 | |||
| 21 | |||
| 22 | def downgrade(): |
||
| 23 | with op.batch_alter_table("concept") as batch_op: |
||
| 24 | batch_op.drop_constraint("uq_concept_concept_id_conceptscheme_id") |
||
| 25 |