"Fossies" - the Fresh Open Source Software Archive

Member "murano-8.0.0/murano/db/cfapi_migration/alembic_migrations/versions/001_initial_version.py" (16 Oct 2019, 2032 Bytes) of package /linux/misc/openstack/murano-8.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. See also the last Fossies "Diffs" side-by-side code changes report for "001_initial_version.py": 6.0.0_vs_7.0.0.

    1 # Licensed under the Apache License, Version 2.0 (the "License");
    2 # you may not use this file except in compliance with the License.
    3 # You may obtain 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,
    9 # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
   10 # implied.
   11 # See the License for the specific language governing permissions and
   12 # limitations under the License.
   13 
   14 """
   15 Revision ID: 001
   16 Revises: None
   17 Create Date: 2016-03-30 16:34:33.698760
   18 
   19 """
   20 
   21 from alembic import op
   22 import sqlalchemy as sa
   23 
   24 # revision identifiers, used by Alembic.
   25 revision = '001'
   26 down_revision = None
   27 
   28 MYSQL_ENGINE = 'InnoDB'
   29 MYSQL_CHARSET = 'utf8'
   30 
   31 
   32 def upgrade():
   33     op.create_table(
   34         'cf_orgs',
   35         sa.Column('id', sa.String(length=255), nullable=False),
   36         sa.Column('tenant', sa.String(length=255), nullable=False),
   37         sa.UniqueConstraint('tenant'),
   38         sa.PrimaryKeyConstraint('id'),
   39         mysql_engine=MYSQL_ENGINE,
   40         mysql_charset=MYSQL_CHARSET)
   41 
   42     op.create_table(
   43         'cf_spaces',
   44         sa.Column('id', sa.String(length=255), nullable=False),
   45         sa.Column('environment_id', sa.String(length=255), nullable=False),
   46         sa.UniqueConstraint('environment_id'),
   47         sa.PrimaryKeyConstraint('id'),
   48         mysql_engine=MYSQL_ENGINE,
   49         mysql_charset=MYSQL_CHARSET)
   50 
   51     op.create_table(
   52         'cf_serv_inst',
   53         sa.Column('id', sa.String(length=255), primary_key=True),
   54         sa.Column('service_id', sa.String(255), nullable=False),
   55         sa.Column('environment_id', sa.String(255), nullable=False),
   56         sa.Column('tenant', sa.String(255), nullable=False),
   57         mysql_engine=MYSQL_ENGINE,
   58         mysql_charset=MYSQL_CHARSET)
   59     # end Alembic commands #
   60 
   61 
   62 def downgrade():
   63     op.drop_table('cf_orgs')
   64     op.drop_table('cf_spaces')
   65     op.drop_table('cf_serv_inst')
   66     # end Alembic commands #