Go to file
Saša Živkov 477f8e2965 postgres: fix PK drop, don't assume PK name as TABLE_pkey
When dropping a primary key, postgres requires the primary key name to
be specified.  In the UpdatePrimaryKeys init step it was assumed that
the primary key name for a table X is always X_pkey. However, since the
Schema_82 this pattern doesn't hold for those tables which were renamed
in that migration, as the migration only renamed the tables. For
example, before Schema_82 we had a table name:

  account_group_includes_by_uuid_audit

and its primary key named:

  account_group_includes_by_uuid_audit_pkey

This table was renamed to:

  account_group_by_id_aud

but the primary key name didn't change. Therefore, the UpdatePrimaryKeys
failed to drop the primary key using the TABLE_pkey pattern and couldn't
then create the new primary key.

Instead of assuming the TABLE_pkey pattern get the old primary key
name from the DatabaseMetaData and use this name for dropping the
existing primary key.

Change-Id: I671b9912110fc22c842d2c15930a2c7b9906bd48
2014-11-28 09:19:01 +01:00
2013-11-28 22:56:51 -08:00
2013-11-30 01:53:00 -08:00
2014-11-12 15:27:53 +09:00
2014-11-12 15:27:53 +09:00
2014-11-26 12:07:11 +09:00
2013-11-28 22:56:51 -08:00
2014-11-12 15:27:53 +09:00
2014-11-06 22:37:15 +09:00
2013-11-29 10:50:59 -08:00
2013-11-09 07:45:00 +01:00
2014-05-01 12:44:01 -07:00
2008-11-14 16:59:34 -08:00
2009-03-27 20:20:10 -07:00
2014-11-12 15:27:53 +09:00
Description
RETIRED, Gerrit as used by OpenStack
120 MiB