Update the migration to reflect the state of the database.
This commit is contained in:
parent
1968c67cba
commit
bbcdf18fdd
1 changed files with 2 additions and 0 deletions
|
@ -35,12 +35,14 @@ def upgrade(tables):
|
||||||
else:
|
else:
|
||||||
raise RuntimeError('Invalid queue name: %s' % item.queue_name)
|
raise RuntimeError('Invalid queue name: %s' % item.queue_name)
|
||||||
|
|
||||||
|
op.create_index('repository_namespace_user_id', 'repository', ['namespace_user_id'], unique=False)
|
||||||
op.drop_column('repository', 'namespace')
|
op.drop_column('repository', 'namespace')
|
||||||
|
|
||||||
|
|
||||||
def downgrade(tables):
|
def downgrade(tables):
|
||||||
# Add the namespace column back in and fill it in
|
# Add the namespace column back in and fill it in
|
||||||
op.add_column('repository', sa.Column('namespace', sa.String(length=255)))
|
op.add_column('repository', sa.Column('namespace', sa.String(length=255)))
|
||||||
|
op.drop_index('repository_namespace_user_id', table_name='repository')
|
||||||
|
|
||||||
# Rename the namespace component of existing queue items to reference namespace strings
|
# Rename the namespace component of existing queue items to reference namespace strings
|
||||||
with app.config['DB_TRANSACTION_FACTORY'](db):
|
with app.config['DB_TRANSACTION_FACTORY'](db):
|
||||||
|
|
Reference in a new issue