Blame alembic/versions/1640c7d75e5f_add_reports_field_to_project.py
|
Pierre-Yves Chibon |
14be83 |
"""Add reports field to project
|
|
Pierre-Yves Chibon |
14be83 |
|
|
Pierre-Yves Chibon |
14be83 |
Revision ID: 1640c7d75e5f
|
|
Pierre-Yves Chibon |
ea386a |
Revises: 1d18843a1994
|
|
Pierre-Yves Chibon |
14be83 |
Create Date: 2016-09-09 16:11:28.099423
|
|
Pierre-Yves Chibon |
14be83 |
|
|
Pierre-Yves Chibon |
14be83 |
"""
|
|
Pierre-Yves Chibon |
14be83 |
|
|
Pierre-Yves Chibon |
14be83 |
# revision identifiers, used by Alembic.
|
|
Pierre-Yves Chibon |
14be83 |
revision = '1640c7d75e5f'
|
|
Pierre-Yves Chibon |
ea386a |
down_revision = '1d18843a1994'
|
|
Pierre-Yves Chibon |
14be83 |
|
|
Pierre-Yves Chibon |
14be83 |
from alembic import op
|
|
Pierre-Yves Chibon |
14be83 |
import sqlalchemy as sa
|
|
Pierre-Yves Chibon |
14be83 |
|
|
Pierre-Yves Chibon |
14be83 |
|
|
Pierre-Yves Chibon |
14be83 |
def upgrade():
|
|
Pierre-Yves Chibon |
14be83 |
''' Add the column _reports to the table projects
|
|
Pierre-Yves Chibon |
14be83 |
'''
|
|
Pierre-Yves Chibon |
14be83 |
op.add_column(
|
|
Pierre-Yves Chibon |
14be83 |
'projects',
|
|
Pierre-Yves Chibon |
14be83 |
sa.Column('_reports', sa.Text, nullable=True)
|
|
Pierre-Yves Chibon |
14be83 |
)
|
|
Pierre-Yves Chibon |
14be83 |
|
|
Pierre-Yves Chibon |
14be83 |
|
|
Pierre-Yves Chibon |
14be83 |
def downgrade():
|
|
Pierre-Yves Chibon |
14be83 |
''' Drop the column _reports from the table projects.
|
|
Pierre-Yves Chibon |
14be83 |
'''
|
|
Pierre-Yves Chibon |
14be83 |
op.drop_column('projects', '_reports')
|