← Back to team overview

yahoo-eng-team team mailing list archive

[Bug 1169381] Re: IntegrityError running sql tests on MySQL/Postgres

 

** Changed in: keystone
       Status: Fix Committed => Fix Released

** Changed in: keystone
    Milestone: None => havana-1

-- 
You received this bug notification because you are a member of Yahoo!
Engineering Team, which is subscribed to Keystone.
https://bugs.launchpad.net/bugs/1169381

Title:
  IntegrityError running sql tests on MySQL/Postgres

Status in OpenStack Identity (Keystone):
  Fix Released

Bug description:
  When running tests/test_sql_upgrade.py against a MySQL or Postgres
  database the tests fail with an IntegrityError.

  see: http://paste.openstack.org/show/36045/

  It appears that this is because migration 020 imposes a foreign key
  restraint in downgrade that wasn't initially present.

  Printing the table structure of 'metadata' before migration 020 gives:

  Table('metadata', MetaData(bind=Engine(mysql://root:test@localhost/keystonetest?charset=utf8)), 
  Column(u'user_id', VARCHAR(length=64), table=<metadata>, primary_key=True, nullable=False), 
  Column(u'tenant_id', VARCHAR(length=64), table=<metadata>, primary_key=True, nullable=False), 
  Column(u'data', MEDIUMTEXT(), table=<metadata>), schema=None)

  Printing the table structure of 'metadata' after migration 020
  downgrade gives:

  Table('metadata', MetaData(bind=Engine(mysql://root:test@localhost/keystonetest?charset=utf8)), 
  Column('user_id', String(length=64), ForeignKey('user.id'), table=<metadata>, primary_key=True, nullable=False),
  Column('tenant_id', String(length=64), table=<metadata>, primary_key=True, nullable=False),
  Column('data', Text(), table=<metadata>), schema=None)

  This is not relevant to whether user_id should be a foreign key,
  simply that the downgrade does not match the upgrade.

To manage notifications about this bug go to:
https://bugs.launchpad.net/keystone/+bug/1169381/+subscriptions