Temporarily put user rename behind a feature flag. Switch queue names back to using the username for namespace while we figure out a real migration strategy.
This commit is contained in:
parent
768a60b414
commit
2b8c246476
9 changed files with 44 additions and 67 deletions
|
@ -0,0 +1,30 @@
|
|||
"""remove the namespace column.
|
||||
|
||||
Revision ID: 2430f55c41d5
|
||||
Revises: 17f11e265e13
|
||||
Create Date: 2014-09-30 17:31:33.308490
|
||||
|
||||
"""
|
||||
|
||||
# revision identifiers, used by Alembic.
|
||||
revision = '2fb36d4be80d'
|
||||
down_revision = '17f11e265e13'
|
||||
|
||||
from alembic import op
|
||||
import sqlalchemy as sa
|
||||
|
||||
import re
|
||||
from app import app
|
||||
|
||||
|
||||
NAMESPACE_EXTRACTOR = re.compile(r'^([a-z]+/)([a-z0-9_]+)(/.*$)')
|
||||
|
||||
|
||||
def upgrade(tables):
|
||||
op.create_index('repository_namespace_user_id', 'repository', ['namespace_user_id'], unique=False)
|
||||
op.drop_column('repository', 'namespace')
|
||||
|
||||
|
||||
def downgrade(tables):
|
||||
op.add_column('repository', sa.Column('namespace', sa.String(length=255)))
|
||||
op.drop_index('repository_namespace_user_id', table_name='repository')
|
Reference in a new issue