~ubuntu-branches/ubuntu/utopic/ironic/utopic

« back to all changes in this revision

Viewing changes to ironic/db/sqlalchemy/alembic/versions/487deb87cc9d_add_conductor_affinity_and_online.py

  • Committer: Package Import Robot
  • Author(s): Adam Gandelman, Adam Gandelman, James Page
  • Date: 2014-09-30 10:44:08 UTC
  • mfrom: (1.2.1) (6.1.1 utopic-proposed)
  • Revision ID: package-import@ubuntu.com-20140930104408-k3z2yaikfvmpkptd
Tags: 2014.2~rc1-0ubuntu1
[ Adam Gandelman ]
* New upstream release.
* debian/patches/set_logdir.patch: Renamed to set_config_defaults.patch,
  also set default sqlite db connection.
* debian/control: Refreshed dependencies for Juno, wrap-and-sort.
* debian/ironic-common.install: Added ironic-nova-bm-migrate binary.
* debian/ironic-common.postinst: Create the default sqlite database if
  configured to use it and it does not exist.
* debian/pydist-overrides: Add pysendfile.
* debian/ironic_sudoers: Add rootwrap.conf (LP: #1185019).

[ James Page ]
* d/rules,control: Increase test verbosity using subunit.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
#    Licensed under the Apache License, Version 2.0 (the "License"); you may
 
2
#    not use this file except in compliance with the License. You may obtain
 
3
#    a copy of the License at
 
4
#
 
5
#         http://www.apache.org/licenses/LICENSE-2.0
 
6
#
 
7
#    Unless required by applicable law or agreed to in writing, software
 
8
#    distributed under the License is distributed on an "AS IS" BASIS, WITHOUT
 
9
#    WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. See the
 
10
#    License for the specific language governing permissions and limitations
 
11
#    under the License.
 
12
 
 
13
"""add conductor_affinity and online
 
14
 
 
15
Revision ID: 487deb87cc9d
 
16
Revises: 3bea56f25597
 
17
Create Date: 2014-09-26 16:16:30.988900
 
18
 
 
19
"""
 
20
 
 
21
# revision identifiers, used by Alembic.
 
22
revision = '487deb87cc9d'
 
23
down_revision = '3bea56f25597'
 
24
 
 
25
from alembic import op
 
26
import sqlalchemy as sa
 
27
 
 
28
 
 
29
def upgrade():
 
30
    op.add_column(
 
31
        'conductors',
 
32
        sa.Column('online', sa.Boolean(), default=True))
 
33
    op.add_column(
 
34
        'nodes',
 
35
        sa.Column('conductor_affinity', sa.Integer(),
 
36
                  sa.ForeignKey('conductors.id',
 
37
                      name='nodes_conductor_affinity_fk'),
 
38
                  nullable=True))
 
39
 
 
40
 
 
41
def downgrade():
 
42
    op.drop_constraint('nodes_conductor_affinity_fk', 'nodes',
 
43
            type_='foreignkey')
 
44
    op.drop_column('nodes', 'conductor_affinity')
 
45
    op.drop_column('conductors', 'online')