"Fossies" - the Fresh Open Source Software Archive

Member "zun-4.0.0/zun/db/sqlalchemy/alembic/versions/a251f1f61217_create_capsule_table.py" (16 Oct 2019, 2304 Bytes) of package /linux/misc/openstack/zun-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 "a251f1f61217_create_capsule_table.py" see the Fossies "Dox" file reference documentation.

    1 # Copyright 2017 ARM Holdings
    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 """create capsule table
   16 
   17 Revision ID: a251f1f61217
   18 Revises: 75315e219cfb
   19 Create Date: 2017-06-20 17:12:56.105277
   20 
   21 """
   22 
   23 # revision identifiers, used by Alembic.
   24 revision = 'a251f1f61217'
   25 down_revision = '75315e219cfb'
   26 branch_labels = None
   27 depends_on = None
   28 
   29 from alembic import op
   30 import sqlalchemy as sa
   31 
   32 from zun.db.sqlalchemy import models
   33 
   34 
   35 def upgrade():
   36     op.create_table(
   37         'capsule',
   38         sa.Column('created_at', sa.DateTime(), nullable=True),
   39         sa.Column('updated_at', sa.DateTime(), nullable=True),
   40         sa.Column('capsule_version', sa.String(length=255), nullable=True),
   41         sa.Column('kind', sa.String(length=36), nullable=True),
   42         sa.Column('project_id', sa.String(length=255), nullable=True),
   43         sa.Column('user_id', sa.String(length=255), nullable=True),
   44         sa.Column('restart_policy', sa.String(length=255), nullable=True),
   45         sa.Column('host_selector', sa.String(length=255), nullable=True),
   46         sa.Column('id', sa.Integer(), nullable=False),
   47         sa.Column('uuid', sa.String(length=36), nullable=False),
   48         sa.Column('status', sa.String(length=255), nullable=True),
   49         sa.Column('status_reason', sa.Text(), nullable=True),
   50         sa.Column('message', models.JSONEncodedDict(), nullable=True),
   51         sa.Column('spec', models.JSONEncodedDict(), nullable=True),
   52         sa.Column('cpu', sa.Float(), nullable=True),
   53         sa.Column('memory', sa.String(length=255), nullable=True),
   54         sa.Column('meta_name', sa.String(length=255), nullable=True),
   55         sa.Column('meta_labels', models.JSONEncodedList(), nullable=True),
   56         sa.Column('containers_uuids', models.JSONEncodedList(), nullable=True),
   57         sa.PrimaryKeyConstraint('id'),
   58     )