Phase 3 of Appr migration

Deletes the old models and their code
This commit is contained in:
Joseph Schorr 2018-07-16 17:12:04 -04:00
parent 223077ef53
commit 487edf0ba1
9 changed files with 218 additions and 167 deletions

View file

@ -13,6 +13,7 @@ down_revision = 'e2894a3a3c19'
from alembic import op
import sqlalchemy as sa
from sqlalchemy.dialects import mysql
from sqlalchemy.sql import table, column
from util.migrate import UTF8LongText, UTF8CharField
@ -274,8 +275,13 @@ def upgrade(tables, tester):
)
op.create_index('manifestlayerscan_layer_id', 'manifestlayerscan', ['layer_id'], unique=True)
blobplacementlocation_table = table('blobplacementlocation',
column('id', sa.Integer()),
column('name', sa.String()),
)
op.bulk_insert(
tables.blobplacementlocation,
blobplacementlocation_table,
[
{'name': 'local_eu'},
{'name': 'local_us'},
@ -297,8 +303,13 @@ def upgrade(tables, tester):
],
)
tagkind_table = table('tagkind',
column('id', sa.Integer()),
column('name', sa.String()),
)
op.bulk_insert(
tables.tagkind,
tagkind_table,
[
{'id': 1, 'name': 'tag'},
{'id': 2, 'name': 'release'},
@ -306,7 +317,6 @@ def upgrade(tables, tester):
]
)
def downgrade(tables, tester):
op.drop_table('manifestlayerscan')
op.drop_table('manifestlayerdockerv1')