From ae9026ee910d96ffeb688274f6619e0da4ea8cb9 Mon Sep 17 00:00:00 2001 From: Jake Moshenko Date: Fri, 26 Sep 2014 14:50:26 -0400 Subject: [PATCH] MySQL will not allow us to revoke the possibility for the namespace_user column to be nullable. --- .../versions/3f4fe1194671_backfill_the_namespace_user_fields.py | 2 -- 1 file changed, 2 deletions(-) diff --git a/data/migrations/versions/3f4fe1194671_backfill_the_namespace_user_fields.py b/data/migrations/versions/3f4fe1194671_backfill_the_namespace_user_fields.py index da95f78fb..cf0b90199 100644 --- a/data/migrations/versions/3f4fe1194671_backfill_the_namespace_user_fields.py +++ b/data/migrations/versions/3f4fe1194671_backfill_the_namespace_user_fields.py @@ -18,10 +18,8 @@ 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') - op.alter_column('repository', 'namespace_user_id', nullable=False, existing_type=sa.Integer) op.create_index('repository_namespace_user_id_name', 'repository', ['namespace_user_id', 'name'], unique=True) def downgrade(tables): op.drop_index('repository_namespace_user_id_name', table_name='repository') - op.alter_column('repository', 'namespace_user_id', nullable=True, existing_type=sa.Integer, server_default=sa.text('NULL'))