Merge remote-tracking branch 'upstream/v2-phase4' into python-registry-v2
This commit is contained in:
commit
fee95bc096
23 changed files with 110 additions and 42 deletions
|
@ -3,9 +3,7 @@ import logging
|
|||
import uuid
|
||||
import time
|
||||
import toposort
|
||||
import base64
|
||||
import resumablehashlib
|
||||
import json
|
||||
|
||||
from random import SystemRandom
|
||||
from datetime import datetime
|
||||
|
@ -15,7 +13,6 @@ from data.fields import ResumableSHAField, JSONField
|
|||
from sqlalchemy.engine.url import make_url
|
||||
from collections import defaultdict
|
||||
|
||||
from data.read_slave import ReadSlaveModel
|
||||
from util.names import urn_generator
|
||||
|
||||
|
||||
|
|
|
@ -108,6 +108,16 @@ test_migrate $MYSQL_CONFIG_OVERRIDE
|
|||
set -e
|
||||
down_mysql
|
||||
|
||||
# Test via Postgres.
|
||||
echo '> Starting Postgres'
|
||||
up_postgres
|
||||
|
||||
echo '> Testing Migration (postgres)'
|
||||
set +e
|
||||
test_migrate $PGSQL_CONFIG_OVERRIDE
|
||||
set -e
|
||||
down_postgres
|
||||
|
||||
# Test via MariaDB.
|
||||
echo '> Starting MariaDB'
|
||||
up_mariadb
|
||||
|
@ -127,13 +137,3 @@ set +e
|
|||
test_migrate $PERCONA_CONFIG_OVERRIDE
|
||||
set -e
|
||||
down_percona
|
||||
|
||||
# Test via Postgres.
|
||||
echo '> Starting Postgres'
|
||||
up_postgres
|
||||
|
||||
echo '> Testing Migration (postgres)'
|
||||
set +e
|
||||
test_migrate $PGSQL_CONFIG_OVERRIDE
|
||||
set -e
|
||||
down_postgres
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '2e0380215d01'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
@ -25,8 +24,8 @@ def upgrade(tables):
|
|||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('imagestorage', sa.Column('created', mysql.DATETIME(), nullable=True))
|
||||
op.add_column('imagestorage', sa.Column('command', mysql.TEXT(), nullable=True))
|
||||
op.add_column('imagestorage', sa.Column('aggregate_size', mysql.BIGINT(display_width=20), autoincrement=False, nullable=True))
|
||||
op.add_column('imagestorage', sa.Column('comment', mysql.TEXT(), nullable=True))
|
||||
op.add_column('imagestorage', sa.Column('created', sa.DateTime(), nullable=True))
|
||||
op.add_column('imagestorage', sa.Column('command', sa.Text(), nullable=True))
|
||||
op.add_column('imagestorage', sa.Column('aggregate_size', sa.BigInteger(), nullable=True))
|
||||
op.add_column('imagestorage', sa.Column('comment', sa.Text(), nullable=True))
|
||||
### end Alembic commands ###
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '5ad999136045'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = 'f42b0ea7a4d'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '313d297811c4'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '2fb36d4be80d'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
from util.migrate.backfill_user_uuids import backfill_user_uuids
|
||||
|
||||
def upgrade(tables):
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '14fe12ade3df'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
from sqlalchemy.exc import InternalError
|
||||
|
||||
def upgrade(tables):
|
||||
|
@ -29,7 +28,7 @@ def upgrade(tables):
|
|||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
try:
|
||||
op.add_column('logentry', sa.Column('access_token_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
|
||||
op.add_column('logentry', sa.Column('access_token_id', sa.Integer(), nullable=True))
|
||||
op.create_foreign_key(u'fk_logentry_access_token_id_accesstoken', 'logentry', 'accesstoken', ['access_token_id'], ['id'])
|
||||
op.create_index('logentry_access_token_id', 'logentry', ['access_token_id'], unique=False)
|
||||
except InternalError:
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '5a07499ce53f'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '707d5191eda'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
op.create_table('star',
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '5b84373e5db'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
op.drop_index('queueitem_queue_name', table_name='queueitem')
|
||||
|
|
|
@ -12,12 +12,11 @@ down_revision = '214350b6a8b1'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('repositorybuild', 'resource_key',
|
||||
existing_type=mysql.VARCHAR(length=255),
|
||||
existing_type=sa.String(length=255),
|
||||
nullable=True)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
@ -25,6 +24,6 @@ def upgrade(tables):
|
|||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('repositorybuild', 'resource_key',
|
||||
existing_type=mysql.VARCHAR(length=255),
|
||||
existing_type=sa.String(length=255),
|
||||
nullable=False)
|
||||
### end Alembic commands ###
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '204abf14783d'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '4b7ef0c7bdb2'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
|
|
@ -0,0 +1,43 @@
|
|||
"""Backport v2 db changes.
|
||||
|
||||
Revision ID: 33bd39ef5ed6
|
||||
Revises: 127905a52fdd
|
||||
Create Date: 2015-10-23 12:34:22.776542
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '33bd39ef5ed6'
|
||||
down_revision = '127905a52fdd'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.create_table('blobupload',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
sa.Column('repository_id', sa.Integer(), nullable=False),
|
||||
sa.Column('uuid', sa.String(length=255), nullable=False),
|
||||
sa.Column('byte_count', sa.Integer(), nullable=False),
|
||||
sa.Column('sha_state', sa.Text(), nullable=True),
|
||||
sa.Column('location_id', sa.Integer(), nullable=False),
|
||||
sa.Column('storage_metadata', sa.Text(), nullable=True),
|
||||
sa.ForeignKeyConstraint(['location_id'], ['imagestoragelocation.id'], name=op.f('fk_blobupload_location_id_imagestoragelocation')),
|
||||
sa.ForeignKeyConstraint(['repository_id'], ['repository.id'], name=op.f('fk_blobupload_repository_id_repository')),
|
||||
sa.PrimaryKeyConstraint('id', name=op.f('pk_blobupload'))
|
||||
)
|
||||
op.create_index('blobupload_location_id', 'blobupload', ['location_id'], unique=False)
|
||||
op.create_index('blobupload_repository_id', 'blobupload', ['repository_id'], unique=False)
|
||||
op.create_index('blobupload_repository_id_uuid', 'blobupload', ['repository_id', 'uuid'], unique=True)
|
||||
op.create_index('blobupload_uuid', 'blobupload', ['uuid'], unique=True)
|
||||
op.add_column(u'imagestorage', sa.Column('cas_path', sa.Boolean(), nullable=False, server_default="0"))
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column(u'imagestorage', 'cas_path')
|
||||
op.drop_table('blobupload')
|
||||
### end Alembic commands ###
|
|
@ -0,0 +1,47 @@
|
|||
"""Switch manifest text to a longtext.
|
||||
|
||||
Revision ID: 35f538da62
|
||||
Revises: 33bd39ef5ed6
|
||||
Create Date: 2015-10-23 15:31:27.353995
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '35f538da62'
|
||||
down_revision = '33bd39ef5ed6'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
from sqlalchemy.types import TypeDecorator, Text
|
||||
from sqlalchemy.dialects.mysql import LONGTEXT
|
||||
import uuid
|
||||
|
||||
class EngineLongText(TypeDecorator):
|
||||
"""Platform-independent LongText type.
|
||||
|
||||
Uses MySQL's LONGTEXT type, otherwise uses
|
||||
Text, because other engines are not as limited
|
||||
as MySQL.
|
||||
|
||||
"""
|
||||
impl = Text
|
||||
|
||||
def load_dialect_impl(self, dialect):
|
||||
if dialect.name == 'mysql':
|
||||
return dialect.type_descriptor(LONGTEXT())
|
||||
else:
|
||||
return dialect.type_descriptor(Text())
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column(u'tagmanifest', 'json_data')
|
||||
op.add_column(u'tagmanifest', sa.Column('json_data', EngineLongText(), nullable=False))
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_column(u'tagmanifest', 'json_data')
|
||||
op.add_column(u'tagmanifest', sa.Column('json_data', sa.Text(), nullable=False))
|
||||
### end Alembic commands ###
|
|
@ -12,12 +12,11 @@ down_revision = '31288f79df53'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('repositorybuildtrigger', 'auth_token',
|
||||
existing_type=mysql.VARCHAR(length=255),
|
||||
existing_type=sa.String(length=255),
|
||||
nullable=True)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
@ -25,6 +24,6 @@ def upgrade(tables):
|
|||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.alter_column('repositorybuildtrigger', 'auth_token',
|
||||
existing_type=mysql.VARCHAR(length=255),
|
||||
existing_type=sa.String(length=255),
|
||||
nullable=False)
|
||||
### end Alembic commands ###
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '1594a74a74ca'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
op.bulk_insert(tables.externalnotificationmethod,
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '43e943c0639f'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '228d1af6af1c'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '4ef04c61fcf9'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
@ -26,7 +25,7 @@ def upgrade(tables):
|
|||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.add_column('repositorybuild', sa.Column('queue_item_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True))
|
||||
op.add_column('repositorybuild', sa.Column('queue_item_id', sa.Integer(), autoincrement=False, nullable=True))
|
||||
op.create_foreign_key(u'fk_repositorybuild_queue_item_id_queueitem', 'repositorybuild', 'queueitem', ['queue_item_id'], ['id'])
|
||||
op.create_index('repositorybuild_queue_item_id', 'repositorybuild', ['queue_item_id'], unique=False)
|
||||
op.drop_index('repositorybuild_queue_id', table_name='repositorybuild')
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '47670cbeced'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
op.bulk_insert(tables.imagestoragelocation,
|
||||
|
|
|
@ -12,7 +12,6 @@ down_revision = '4fdb65816b8d'
|
|||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
from sqlalchemy.dialects import mysql
|
||||
|
||||
def upgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
|
|
Reference in a new issue