Skip to content

Commit

Permalink
Merge "Fix QoS standardattr migration foreign key step"
Browse files Browse the repository at this point in the history
  • Loading branch information
Jenkins authored and openstack-gerrit committed Sep 1, 2016
2 parents b5f7a53 + f91d84c commit e8b0d77
Showing 1 changed file with 5 additions and 5 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -50,18 +50,18 @@
def upgrade():
generate_records_for_existing()
# add the constraint now that everything is populated on that table
op.create_foreign_key(
constraint_name=None, source_table=TABLE,
referent_table='standardattributes',
local_cols=['standard_attr_id'], remote_cols=['id'],
ondelete='CASCADE')
op.alter_column(TABLE, 'standard_attr_id', nullable=False,
existing_type=sa.BigInteger(), existing_nullable=True,
existing_server_default=False)
op.create_unique_constraint(
constraint_name='uniq_%s0standard_attr_id' % TABLE,
table_name=TABLE, columns=['standard_attr_id'])
op.drop_column(TABLE, 'description')
op.create_foreign_key(
constraint_name=None, source_table=TABLE,
referent_table='standardattributes',
local_cols=['standard_attr_id'], remote_cols=['id'],
ondelete='CASCADE')


def generate_records_for_existing():
Expand Down

0 comments on commit e8b0d77

Please sign in to comment.