"Fossies" - the Fresh Open Source Software Archive

Member "cloudkitty-13.0.0/cloudkitty/rating/pyscripts/db/sqlalchemy/alembic/versions/75c205f6f1a2_move_from_sha1_to_sha512.py" (14 Oct 2020, 1412 Bytes) of package /linux/misc/openstack/cloudkitty-13.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 "75c205f6f1a2_move_from_sha1_to_sha512.py" see the Fossies "Dox" file reference documentation and the latest Fossies "Diffs" side-by-side code changes report: 12.1.0_vs_13.0.0.

    1 # Copyright 2019 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 """move from sha1 to sha512
   17 
   18 Revision ID: 75c205f6f1a2
   19 Revises: 4f9efa4601c0
   20 Create Date: 2019-03-25 13:53:23.398755
   21 
   22 """
   23 
   24 # revision identifiers, used by Alembic.
   25 revision = '75c205f6f1a2'
   26 down_revision = '4f9efa4601c0'
   27 
   28 from alembic import op  # noqa: E402
   29 import sqlalchemy as sa  # noqa: E402
   30 
   31 
   32 def upgrade():
   33     with op.batch_alter_table('pyscripts_scripts') as batch_op:
   34         batch_op.alter_column('checksum',
   35                               existing_type=sa.VARCHAR(length=40),
   36                               type_=sa.String(length=128))
   37 
   38 
   39 def downgrade():
   40     with op.batch_alter_table('pyscripts_scripts') as batch_op:
   41         batch_op.alter_column('checksum',
   42                               existing_type=sa.String(length=128),
   43                               type_=sa.VARCHAR(length=40))