Esempio n. 1
0
def upgrade(migrate_engine):
    meta = sqlalchemy.schema.MetaData(migrate_engine)

    # NOTE(bcwaldon): load the images table for the ForeignKey below
    sqlalchemy.Table('images', meta, autoload=True)

    image_locations_table = sqlalchemy.Table(
        'image_locations',
        meta,
        sqlalchemy.Column('id',
                          schema.Integer(),
                          primary_key=True,
                          nullable=False),
        sqlalchemy.Column('image_id',
                          schema.String(36),
                          sqlalchemy.ForeignKey('images.id'),
                          nullable=False,
                          index=True),
        sqlalchemy.Column('value', schema.Text(), nullable=False),
        sqlalchemy.Column('created_at', schema.DateTime(), nullable=False),
        sqlalchemy.Column('updated_at', schema.DateTime()),
        sqlalchemy.Column('deleted_at', schema.DateTime()),
        sqlalchemy.Column('deleted',
                          schema.Boolean(),
                          nullable=False,
                          default=False,
                          index=True),
        mysql_engine='InnoDB',
        mysql_charset='utf8',
    )

    schema.create_tables([image_locations_table])
def upgrade(migrate_engine):
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_artifacts_table(meta),
              define_artifact_tags_table(meta),
              define_artifact_properties_table(meta),
              define_artifact_blobs_table(meta),
              define_artifact_blob_locations_table(meta),
              define_artifact_dependencies_table(meta)]
    create_tables(tables)
def upgrade(migrate_engine):
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_metadef_namespaces_table(meta),
              define_metadef_objects_table(meta),
              define_metadef_properties_table(meta),
              define_metadef_resource_types_table(meta),
              define_metadef_namespace_resource_types_table(meta)]
    create_tables(tables)

    resource_types_table = _get_metadef_resource_types_table(meta)
    _populate_resource_types(resource_types_table)
def upgrade(migrate_engine):
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [
        define_artifacts_table(meta),
        define_artifact_tags_table(meta),
        define_artifact_properties_table(meta),
        define_artifact_blobs_table(meta),
        define_artifact_blob_locations_table(meta),
        define_artifact_dependencies_table(meta)
    ]
    create_tables(tables)
Esempio n. 5
0
def upgrade(migrate_engine):
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [
        define_metadef_namespaces_table(meta),
        define_metadef_objects_table(meta),
        define_metadef_properties_table(meta),
        define_metadef_resource_types_table(meta),
        define_metadef_namespace_resource_types_table(meta)
    ]
    create_tables(tables)

    resource_types_table = _get_metadef_resource_types_table(meta)
    _populate_resource_types(resource_types_table)
Esempio n. 6
0
def upgrade(migrate_engine):
    meta = MetaData()
    meta.bind = migrate_engine

    tables = [define_task_info_table(meta)]
    create_tables(tables)

    tasks_table = Table('tasks', meta, autoload=True)
    task_info_table = Table('task_info', meta, autoload=True)

    tasks = tasks_table.select().execute().fetchall()
    for task in tasks:
        values = {
            'task_id': task.id,
            'input': task.input,
            'result': task.result,
            'message': task.message,
        }
        task_info_table.insert(values=values).execute()

    for col_name in TASKS_MIGRATE_COLUMNS:
        tasks_table.columns[col_name].drop()
def upgrade(migrate_engine):
    meta = sqlalchemy.schema.MetaData(migrate_engine)

    # NOTE(bcwaldon): load the images table for the ForeignKey below
    sqlalchemy.Table('images', meta, autoload=True)

    image_locations_table = sqlalchemy.Table(
        'image_locations', meta,
        sqlalchemy.Column('id',
                          schema.Integer(),
                          primary_key=True,
                          nullable=False),
        sqlalchemy.Column('image_id',
                          schema.String(36),
                          sqlalchemy.ForeignKey('images.id'),
                          nullable=False,
                          index=True),
        sqlalchemy.Column('value',
                          schema.Text(),
                          nullable=False),
        sqlalchemy.Column('created_at',
                          schema.DateTime(),
                          nullable=False),
        sqlalchemy.Column('updated_at',
                          schema.DateTime()),
        sqlalchemy.Column('deleted_at',
                          schema.DateTime()),
        sqlalchemy.Column('deleted',
                          schema.Boolean(),
                          nullable=False,
                          default=False,
                          index=True),
        mysql_engine='InnoDB',
        mysql_charset='utf8',
    )

    schema.create_tables([image_locations_table])
Esempio n. 8
0
def upgrade(migrate_engine):
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [get_image_members_table(meta)]
    create_tables(tables)
Esempio n. 9
0
def upgrade(migrate_engine):
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_tasks_table(meta)]
    create_tables(tables)
def upgrade(migrate_engine):
    meta = schema.MetaData()
    meta.bind = migrate_engine
    tables = [define_image_tags_table(meta)]
    glance_schema.create_tables(tables)
def upgrade(migrate_engine):
    meta = MetaData()
    meta.bind = migrate_engine
    tables = [define_image_properties_table(meta)]
    create_tables(tables)
def upgrade(migrate_engine):
    meta = schema.MetaData()
    meta.bind = migrate_engine
    tables = [define_image_tags_table(meta)]
    glance_schema.create_tables(tables)