| 1 |
# Copyright (C) 2012-2013 Yahoo! Inc. All Rights Reserved. |
| 2 |
# |
| 3 |
# Licensed under the Apache License, Version 2.0 (the "License"); you may |
| 4 |
# not use this file except in compliance with the License. You may obtain |
| 5 |
# a copy of the License at |
| 6 |
# |
| 7 |
# http://www.apache.org/licenses/LICENSE-2.0 |
| 8 |
# |
| 9 |
# Unless required by applicable law or agreed to in writing, software |
| 10 |
# distributed under the License is distributed on an "AS IS" BASIS, WITHOUT |
| 11 |
# WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the |
| 12 |
# License for the specific language governing permissions and limitations |
| 13 |
# under the License. |
| 14 |
|
| 15 |
"""Replace exception and stacktrace with failure column |
| 16 |
|
| 17 |
Revision ID: 1c783c0c2875 |
| 18 |
Revises: 1cea328f0f65 |
| 19 |
Create Date: 2013-09-26 12:33:30.970122 |
| 20 |
|
| 21 |
""" |
| 22 |
|
| 23 |
# revision identifiers, used by Alembic. |
| 24 |
revision = '1c783c0c2875' |
| 25 |
down_revision = '1cea328f0f65' |
| 26 |
|
| 27 |
from alembic import op |
| 28 |
import sqlalchemy as sa |
| 29 |
|
| 30 |
|
| 31 |
def upgrade(): |
| 32 |
op.add_column('taskdetails', |
| 33 |
sa.Column('failure', sa.Text(), nullable=True)) |
| 34 |
op.drop_column('taskdetails', 'exception') |
| 35 |
op.drop_column('taskdetails', 'stacktrace') |
| 36 |
|
| 37 |
|
| 38 |
def downgrade(): |
| 39 |
op.drop_column('taskdetails', 'failure') |
| 40 |
op.add_column('taskdetails', |
| 41 |
sa.Column('stacktrace', sa.Text(), nullable=True)) |
| 42 |
op.add_column('taskdetails', |
| 43 |
sa.Column('exception', sa.Text(), nullable=True)) |