Merge pull request #264 from coreos-inc/missingmigration
Add missing migration
This commit is contained in:
commit
6ba2d972d2
2 changed files with 38 additions and 2 deletions
|
@ -582,8 +582,9 @@ class RepositoryTag(BaseModel):
|
||||||
|
|
||||||
|
|
||||||
class TagManifest(BaseModel):
|
class TagManifest(BaseModel):
|
||||||
tag = ForeignKeyField(RepositoryTag)
|
tag = ForeignKeyField(RepositoryTag, index=True, unique=True)
|
||||||
digest = CharField(index=True)
|
digest = CharField(index=True, unique=True)
|
||||||
|
json_data = TextField()
|
||||||
|
|
||||||
|
|
||||||
class BUILD_PHASE(object):
|
class BUILD_PHASE(object):
|
||||||
|
|
|
@ -0,0 +1,35 @@
|
||||||
|
"""Add missing tag manifest table
|
||||||
|
|
||||||
|
Revision ID: 2e09ad97b06c
|
||||||
|
Revises: 2bf8af5bad95
|
||||||
|
Create Date: 2015-07-22 16:10:42.549566
|
||||||
|
|
||||||
|
"""
|
||||||
|
|
||||||
|
# revision identifiers, used by Alembic.
|
||||||
|
revision = '2e09ad97b06c'
|
||||||
|
down_revision = '2bf8af5bad95'
|
||||||
|
|
||||||
|
from alembic import op
|
||||||
|
import sqlalchemy as sa
|
||||||
|
|
||||||
|
|
||||||
|
def upgrade(tables):
|
||||||
|
### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.create_table('tagmanifest',
|
||||||
|
sa.Column('id', sa.Integer(), nullable=False),
|
||||||
|
sa.Column('tag_id', sa.Integer(), nullable=False),
|
||||||
|
sa.Column('digest', sa.String(length=255), nullable=False),
|
||||||
|
sa.Column('json_data', sa.Text(), nullable=False),
|
||||||
|
sa.ForeignKeyConstraint(['tag_id'], ['repositorytag.id'], name=op.f('fk_tagmanifest_tag_id_repositorytag')),
|
||||||
|
sa.PrimaryKeyConstraint('id', name=op.f('pk_tagmanifest'))
|
||||||
|
)
|
||||||
|
op.create_index('tagmanifest_digest', 'tagmanifest', ['digest'], unique=True)
|
||||||
|
op.create_index('tagmanifest_tag_id', 'tagmanifest', ['tag_id'], unique=True)
|
||||||
|
### end Alembic commands ###
|
||||||
|
|
||||||
|
|
||||||
|
def downgrade(tables):
|
||||||
|
### commands auto generated by Alembic - please adjust! ###
|
||||||
|
op.drop_table('tagmanifest')
|
||||||
|
### end Alembic commands ###
|
Reference in a new issue