"Fossies" - the Fresh Open Source Software Archive

Member "tacker-4.0.0/tacker/db/migration/alembic_migrations/versions/12a57080b278_alter_devices.py" (14 Oct 2020, 1461 Bytes) of package /linux/misc/openstack/tacker-4.0.0.tar.gz:


As a special service "Fossies" has tried to format the requested source page into HTML format using (guessed) Python source code syntax highlighting (style: standard) with prefixed line numbers. Alternatively you can here view or download the uninterpreted source code file. For more information about "12a57080b278_alter_devices.py" see the Fossies "Dox" file reference documentation and the last Fossies "Diffs" side-by-side code changes report: 4.0.0_vs_5.0.0.

    1 # Copyright 2015 OpenStack Foundation
    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 
   16 """Alter devices
   17 
   18 Revision ID: 12a57080b278
   19 Revises: 12a57080b277
   20 Create Date: 2015-11-26 15:18:19.623170
   21 
   22 """
   23 
   24 # flake8: noqa: E402
   25 
   26 # revision identifiers, used by Alembic.
   27 revision = '12a57080b278'
   28 down_revision = '12a57080b277'
   29 
   30 from alembic import op
   31 from sqlalchemy.dialects import mysql
   32 from tacker.db import migration
   33 
   34 
   35 def upgrade(active_plugins=None, options=None):
   36     # commands auto generated by Alembic - please adjust! #
   37     fk_constraint = ('deviceattributes', )
   38     with migration.modify_foreign_keys_constraint(fk_constraint):
   39         op.alter_column(u'deviceattributes', 'device_id',
   40                         existing_type=mysql.VARCHAR(length=255),
   41                         nullable=False)
   42     op.alter_column(u'devices', 'status', existing_type=mysql.VARCHAR(
   43         length=255), nullable=False)
   44     # end Alembic commands #s