Blame alembic/versions/e4dbfcd20f42_add_default_priority_to_projects.py
|
Pierre-Yves Chibon |
dff667 |
"""Add default_priority to projects
|
|
Pierre-Yves Chibon |
dff667 |
|
|
Pierre-Yves Chibon |
dff667 |
Revision ID: e4dbfcd20f42
|
|
Pierre-Yves Chibon |
dff667 |
Revises: 21292448a775
|
|
Pierre-Yves Chibon |
dff667 |
Create Date: 2017-10-20 13:34:01.323657
|
|
Pierre-Yves Chibon |
dff667 |
|
|
Pierre-Yves Chibon |
dff667 |
"""
|
|
Pierre-Yves Chibon |
dff667 |
|
|
Pierre-Yves Chibon |
dff667 |
# revision identifiers, used by Alembic.
|
|
Pierre-Yves Chibon |
dff667 |
revision = 'e4dbfcd20f42'
|
|
Pierre-Yves Chibon |
dff667 |
down_revision = '21292448a775'
|
|
Pierre-Yves Chibon |
dff667 |
|
|
Pierre-Yves Chibon |
dff667 |
|
|
Pierre-Yves Chibon |
dff667 |
from alembic import op
|
|
Pierre-Yves Chibon |
dff667 |
import sqlalchemy as sa
|
|
Pierre-Yves Chibon |
dff667 |
|
|
Pierre-Yves Chibon |
dff667 |
|
|
Pierre-Yves Chibon |
dff667 |
def upgrade():
|
|
Pierre-Yves Chibon |
dff667 |
''' Add default_priority column to projects table'''
|
|
Pierre-Yves Chibon |
dff667 |
|
|
Pierre-Yves Chibon |
dff667 |
op.add_column(
|
|
Pierre-Yves Chibon |
dff667 |
'projects',
|
|
Pierre-Yves Chibon |
dff667 |
sa.Column('default_priority', sa.Text, nullable=True)
|
|
Pierre-Yves Chibon |
dff667 |
)
|
|
Pierre-Yves Chibon |
dff667 |
|
|
Pierre-Yves Chibon |
dff667 |
def downgrade():
|
|
Pierre-Yves Chibon |
dff667 |
''' Revert the default_priority column added'''
|
|
Pierre-Yves Chibon |
dff667 |
op.drop_column('projects', 'default_priority')
|