Migrate from cnr -> appr
This commit is contained in:
parent
fe6760749a
commit
6336a4a971
16 changed files with 106 additions and 68 deletions
35
data/migrations/versions/5d4ae648155c_add_mediatypes.py
Normal file
35
data/migrations/versions/5d4ae648155c_add_mediatypes.py
Normal file
|
@ -0,0 +1,35 @@
|
|||
"""add_mediatypes
|
||||
|
||||
Revision ID: 5d4ae648155c
|
||||
Revises: d8989249f8f6
|
||||
Create Date: 2017-08-04 16:01:47.573800
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '5d4ae648155c'
|
||||
down_revision = 'd8989249f8f6'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
mtypes = ['helm', 'kpm', 'docker-compose', 'ksonnet', 'appr', 'kubernetes']
|
||||
data = []
|
||||
for mtype in mtypes:
|
||||
data.append({'name': 'application/vnd.appr.package-manifest.%s.v0.json' % mtype})
|
||||
data.append({'name': 'application/vnd.appr.package.%s.v0.tar+gzip' % mtype})
|
||||
|
||||
op.bulk_insert(
|
||||
tables.mediatype,
|
||||
[
|
||||
{'name': 'application/vnd.appr.blob.v0.tar+gzip'},
|
||||
{'name': 'application/vnd.appr.manifests.v0.json'},
|
||||
{'name': 'application/vnd.appr.manifest.list.v0.json'},
|
||||
] + data,
|
||||
)
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
pass
|
Reference in a new issue