Update the migration to reflect the state of the database.

This commit is contained in:
Jake Moshenko 2014-10-07 16:19:05 -04:00
parent 1968c67cba
commit bbcdf18fdd

View file

@ -35,12 +35,14 @@ def upgrade(tables):
else:
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')
def downgrade(tables):
# Add the namespace column back in and fill it in
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
with app.config['DB_TRANSACTION_FACTORY'](db):