summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/operations.py
diff options
context:
space:
mode:
authorRussell Keith-Magee <russell@keith-magee.com>2010-07-30 02:42:36 +0000
committerRussell Keith-Magee <russell@keith-magee.com>2010-07-30 02:42:36 +0000
commitbab9aab9a2cd82706e2a15044db40b9fc85afbc5 (patch)
tree545aac0da4eafaa34d94ff4560f8efc6fd213398 /django/db/backends/postgresql/operations.py
parentcd8758ef4dd28f55858d1df65bf5d4ce07137eb1 (diff)
downloaddjango-bab9aab9a2cd82706e2a15044db40b9fc85afbc5.tar.gz
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
Diffstat (limited to 'django/db/backends/postgresql/operations.py')
-rw-r--r--django/db/backends/postgresql/operations.py2
1 files changed, 1 insertions, 1 deletions
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')),