"Fossies" - the Fresh Open Source Software Archive

Member "qinling-3.0.0/qinling/db/sqlalchemy/migration/alembic_migrations/versions/011_function_id_for_webhook.py" (16 Oct 2019, 1060 Bytes) of package /linux/misc/openstack/qinling-3.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 "011_function_id_for_webhook.py" see the Fossies "Dox" file reference documentation.

    1 # Copyright 2019 - Ormuco Inc.
    2 #
    3 #    Licensed under the Apache License, Version 2.0 (the "License");
    4 #    you may not use this file except in compliance with the License.
    5 #    You may obtain 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,
   11 #    WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
   12 #    See the License for the specific language governing permissions and
   13 #    limitations under the License.
   14 
   15 """Make function id nullable for webhooks table
   16 
   17 Revision ID: 011
   18 Revises: 010
   19 """
   20 
   21 revision = '011'
   22 down_revision = '010'
   23 
   24 from alembic import op
   25 import sqlalchemy as sa
   26 
   27 
   28 def upgrade():
   29     op.alter_column(
   30         'webhooks',
   31         'function_id',
   32         existing_type=sa.String(length=36),
   33         nullable=True
   34     )
   35     op.alter_column(
   36         'webhooks',
   37         'function_version',
   38         existing_type=sa.Integer,
   39         nullable=True
   40     )