Merge remote-tracking branch 'origin/laffa' into nomenclature
This commit is contained in:
commit
1968c67cba
4 changed files with 6 additions and 18 deletions
|
@ -256,7 +256,7 @@ class EmailConfirmation(BaseModel):
|
|||
|
||||
|
||||
class ImageStorage(BaseModel):
|
||||
uuid = CharField(default=uuid_generator, index=True)
|
||||
uuid = CharField(default=uuid_generator, index=True, unique=True)
|
||||
checksum = CharField(null=True)
|
||||
created = DateTimeField(null=True)
|
||||
comment = TextField(null=True)
|
||||
|
|
|
@ -35,11 +35,11 @@ down_postgres() {
|
|||
}
|
||||
|
||||
gen_migrate() {
|
||||
# Generate the migration to the current model.
|
||||
GENMIGRATE=$1 PYTHONPATH=. alembic revision --autogenerate -m "$@"
|
||||
|
||||
# Generate a SQLite database with the schema as defined by the existing alembic model.
|
||||
GENMIGRATE=$1 PYTHONPATH=. alembic upgrade head
|
||||
|
||||
# Generate the migration to the current model.
|
||||
GENMIGRATE=$1 PYTHONPATH=. alembic revision --autogenerate -m "$2"
|
||||
}
|
||||
|
||||
test_migrate() {
|
||||
|
@ -59,7 +59,7 @@ if [ ! -z "$@" ]
|
|||
then
|
||||
set +e
|
||||
echo '> Generating Migration'
|
||||
gen_migrate "mysql"
|
||||
gen_migrate "mysql" "$@"
|
||||
set -e
|
||||
fi
|
||||
|
||||
|
|
|
@ -35,23 +35,11 @@ def upgrade(tables):
|
|||
op.create_index('derivedimagestorage_source_id', 'derivedimagestorage', ['source_id'], unique=False)
|
||||
op.create_index('derivedimagestorage_source_id_transformation_id', 'derivedimagestorage', ['source_id', 'transformation_id'], unique=True)
|
||||
op.create_index('derivedimagestorage_transformation_id', 'derivedimagestorage', ['transformation_id'], unique=False)
|
||||
op.drop_index('image_repository_id_docker_image_id', table_name='image')
|
||||
op.create_index('image_repository_id_docker_image_id', 'image', ['repository_id', 'docker_image_id'], unique=True)
|
||||
op.drop_index('imagestorage_uuid', table_name='imagestorage')
|
||||
op.create_index('imagestorage_uuid', 'imagestorage', ['uuid'], unique=False)
|
||||
op.drop_column(u'repository', 'namespace')
|
||||
op.create_index('repository_namespace_user_id', 'repository', ['namespace_user_id'], unique=False)
|
||||
### end Alembic commands ###
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
### commands auto generated by Alembic - please adjust! ###
|
||||
op.drop_index('repository_namespace_user_id', table_name='repository')
|
||||
op.add_column(u'repository', sa.Column('namespace', sa.String(length=255), nullable=True))
|
||||
op.drop_index('imagestorage_uuid', table_name='imagestorage')
|
||||
op.create_index('imagestorage_uuid', 'imagestorage', ['uuid'], unique=True)
|
||||
op.drop_index('image_repository_id_docker_image_id', table_name='image')
|
||||
op.create_index('image_repository_id_docker_image_id', 'image', ['repository_id', 'docker_image_id'], unique=False)
|
||||
op.drop_table('derivedimagestorage')
|
||||
op.drop_table('imagestoragetransformation')
|
||||
### end Alembic commands ###
|
||||
|
|
|
@ -378,7 +378,7 @@ def upgrade(tables):
|
|||
)
|
||||
op.create_index('image_ancestors', 'image', ['ancestors'], unique=False)
|
||||
op.create_index('image_repository_id', 'image', ['repository_id'], unique=False)
|
||||
op.create_index('image_repository_id_docker_image_id', 'image', ['repository_id', 'docker_image_id'], unique=False)
|
||||
op.create_index('image_repository_id_docker_image_id', 'image', ['repository_id', 'docker_image_id'], unique=True)
|
||||
op.create_index('image_storage_id', 'image', ['storage_id'], unique=False)
|
||||
op.create_table('permissionprototype',
|
||||
sa.Column('id', sa.Integer(), nullable=False),
|
||||
|
|
Reference in a new issue