forked from apache/airflow
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[AIRFLOW-291] Add index for state in TI table
Closes apache#1635 from aoen/ddavydov/add_index_to_task_instance_state
- Loading branch information
Showing
2 changed files
with
24 additions
and
0 deletions.
There are no files selected for viewing
23 changes: 23 additions & 0 deletions
23
airflow/migrations/versions/211e584da130_add_ti_state_index.py
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,23 @@ | ||
"""add TI state index | ||
Revision ID: 211e584da130 | ||
Revises: 2e82aab8ef20 | ||
Create Date: 2016-06-30 10:54:24.323588 | ||
""" | ||
|
||
# revision identifiers, used by Alembic. | ||
revision = '211e584da130' | ||
down_revision = '2e82aab8ef20' | ||
branch_labels = None | ||
depends_on = None | ||
|
||
from alembic import op | ||
import sqlalchemy as sa | ||
|
||
|
||
def upgrade(): | ||
op.create_index('ti_state', 'task_instance', ['state'], unique=False) | ||
|
||
def downgrade(): | ||
op.drop_index('ti_state', table_name='task_instance') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters