Merge pull request #989 from coreos-inc/derivedfix-part2

Remove DerivedImageStorage table
This commit is contained in:
josephschorr 2015-11-25 13:36:53 -05:00
commit 955ff20068
2 changed files with 38 additions and 15 deletions

View file

@ -514,20 +514,6 @@ class ImageStorageSignature(BaseModel):
) )
# NOTE: This table is *deprecated* and will be removed in the next PR.
class DerivedImageStorage(BaseModel):
source = ForeignKeyField(ImageStorage, null=True, related_name='source')
derivative = ForeignKeyField(ImageStorage, related_name='derivative')
transformation = ForeignKeyField(ImageStorageTransformation)
class Meta:
database = db
read_slaves = (read_slave,)
indexes = (
(('source', 'transformation'), True),
)
class ImageStorageLocation(BaseModel): class ImageStorageLocation(BaseModel):
name = CharField(unique=True, index=True) name = CharField(unique=True, index=True)
@ -842,7 +828,7 @@ all_models = [User, Repository, Image, AccessToken, Role, RepositoryPermission,
OAuthApplication, OAuthAuthorizationCode, OAuthAccessToken, NotificationKind, OAuthApplication, OAuthAuthorizationCode, OAuthAccessToken, NotificationKind,
Notification, ImageStorageLocation, ImageStoragePlacement, Notification, ImageStorageLocation, ImageStoragePlacement,
ExternalNotificationEvent, ExternalNotificationMethod, RepositoryNotification, ExternalNotificationEvent, ExternalNotificationMethod, RepositoryNotification,
RepositoryAuthorizedEmail, ImageStorageTransformation, DerivedImageStorage, RepositoryAuthorizedEmail, ImageStorageTransformation,
TeamMemberInvite, ImageStorageSignature, ImageStorageSignatureKind, TeamMemberInvite, ImageStorageSignature, ImageStorageSignatureKind,
AccessTokenKind, Star, RepositoryActionCount, TagManifest, UserRegion, AccessTokenKind, Star, RepositoryActionCount, TagManifest, UserRegion,
QuayService, QuayRegion, QuayRelease, BlobUpload, DerivedStorageForImage] QuayService, QuayRegion, QuayRelease, BlobUpload, DerivedStorageForImage]

View file

@ -0,0 +1,37 @@
"""Remove DerivedImageStorage table
Revision ID: 1849ca8199fc
Revises: 5a2445ffe21b
Create Date: 2015-11-25 11:45:32.928533
"""
# revision identifiers, used by Alembic.
revision = '1849ca8199fc'
down_revision = '5a2445ffe21b'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
def upgrade(tables):
### commands auto generated by Alembic - please adjust! ###
op.drop_table('derivedimagestorage')
### end Alembic commands ###
def downgrade(tables):
### commands auto generated by Alembic - please adjust! ###
op.create_table('derivedimagestorage',
sa.Column('id', mysql.INTEGER(display_width=11), nullable=False),
sa.Column('source_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=True),
sa.Column('derivative_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
sa.Column('transformation_id', mysql.INTEGER(display_width=11), autoincrement=False, nullable=False),
sa.ForeignKeyConstraint(['derivative_id'], [u'imagestorage.id'], name=u'fk_derivedimagestorage_derivative_id_imagestorage'),
sa.ForeignKeyConstraint(['source_id'], [u'imagestorage.id'], name=u'fk_derivedimagestorage_source_id_imagestorage'),
sa.ForeignKeyConstraint(['transformation_id'], [u'imagestoragetransformation.id'], name=u'fk_dis_transformation_id_ist'),
sa.PrimaryKeyConstraint('id'),
mysql_default_charset=u'latin1',
mysql_engine=u'InnoDB'
)
### end Alembic commands ###