From bab9aab9a2cd82706e2a15044db40b9fc85afbc5 Mon Sep 17 00:00:00 2001 From: Russell Keith-Magee Date: Fri, 30 Jul 2010 02:42:36 +0000 Subject: Fixed #13941 -- Corrected the way sequence names are reset under Postgres, especially when generic foreign keys are involved. Thanks to Ales Zoulek for the report and patch. git-svn-id: http://code.djangoproject.com/svn/django/trunk@13449 bcc190cf-cafb-0310-a4f2-bffc1f526a37 --- django/db/backends/postgresql/operations.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) (limited to 'django/db/backends/postgresql') diff --git a/django/db/backends/postgresql/operations.py b/django/db/backends/postgresql/operations.py index 76f25410fb..b6164dfea4 100644 --- a/django/db/backends/postgresql/operations.py +++ b/django/db/backends/postgresql/operations.py @@ -132,7 +132,7 @@ class DatabaseOperations(BaseDatabaseOperations): if not f.rel.through: output.append("%s setval(pg_get_serial_sequence('%s','%s'), coalesce(max(%s), 1), max(%s) %s null) %s %s;" % \ (style.SQL_KEYWORD('SELECT'), - style.SQL_TABLE(model._meta.db_table), + style.SQL_TABLE(f.m2m_db_table()), style.SQL_FIELD('id'), style.SQL_FIELD(qn('id')), style.SQL_FIELD(qn('id')), -- cgit v1.3