Fix the SQL migration.
This commit is contained in:
parent
03190efde3
commit
e9745dbc96
1 changed files with 1 additions and 1 deletions
|
@ -16,7 +16,7 @@ import sqlalchemy as sa
|
|||
|
||||
def upgrade(tables):
|
||||
conn = op.get_bind()
|
||||
conn.execute('update repository set namespace_user_id = (select id from user where user.username == repository.namespace) where namespace_user_id is NULL')
|
||||
conn.execute('update repository set namespace_user_id = (select id from user where user.username = repository.namespace) where namespace_user_id is NULL')
|
||||
|
||||
op.alter_column('repository', 'namespace_user_id', nullable=False)
|
||||
op.create_index('repository_namespace_user_id_name', 'repository', ['namespace_user_id', 'name'], unique=True)
|
||||
|
|
Reference in a new issue