mirror of https://github.com/django/django.git
Fixed #4057 -- Fixed problem with quoting of sequence names on Postgres backends. Thanks, Gary Wilson.
git-svn-id: http://code.djangoproject.com/svn/django/trunk@5017 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
parent
c64f7f065a
commit
c5f08954d5
|
@ -192,7 +192,7 @@ def get_sql_flush(style, tables, sequences):
|
|||
sql.append("%s %s %s %s %s %s;" % \
|
||||
(style.SQL_KEYWORD('ALTER'),
|
||||
style.SQL_KEYWORD('SEQUENCE'),
|
||||
style.SQL_FIELD('%s_%s_seq' % (table_name, column_name)),
|
||||
style.SQL_FIELD(quote_name('%s_%s_seq' % (table_name, column_name))),
|
||||
style.SQL_KEYWORD('RESTART'),
|
||||
style.SQL_KEYWORD('WITH'),
|
||||
style.SQL_FIELD('1')
|
||||
|
@ -203,7 +203,7 @@ def get_sql_flush(style, tables, sequences):
|
|||
sql.append("%s %s %s %s %s %s;" % \
|
||||
(style.SQL_KEYWORD('ALTER'),
|
||||
style.SQL_KEYWORD('SEQUENCE'),
|
||||
style.SQL_FIELD('%s_id_seq' % table_name),
|
||||
style.SQL_FIELD(quote_name('%s_id_seq' % table_name)),
|
||||
style.SQL_KEYWORD('RESTART'),
|
||||
style.SQL_KEYWORD('WITH'),
|
||||
style.SQL_FIELD('1')
|
||||
|
|
|
@ -149,7 +149,7 @@ def get_sql_flush(style, tables, sequences):
|
|||
sql.append("%s %s %s %s %s %s;" % \
|
||||
(style.SQL_KEYWORD('ALTER'),
|
||||
style.SQL_KEYWORD('SEQUENCE'),
|
||||
style.SQL_FIELD('%s_%s_seq' % (table_name, column_name)),
|
||||
style.SQL_FIELD(quote_name('%s_%s_seq' % (table_name, column_name))),
|
||||
style.SQL_KEYWORD('RESTART'),
|
||||
style.SQL_KEYWORD('WITH'),
|
||||
style.SQL_FIELD('1')
|
||||
|
@ -160,7 +160,7 @@ def get_sql_flush(style, tables, sequences):
|
|||
sql.append("%s %s %s %s %s %s;" % \
|
||||
(style.SQL_KEYWORD('ALTER'),
|
||||
style.SQL_KEYWORD('SEQUENCE'),
|
||||
style.SQL_FIELD('%s_id_seq' % table_name),
|
||||
style.SQL_FIELD(quote_name('%s_id_seq' % table_name)),
|
||||
style.SQL_KEYWORD('RESTART'),
|
||||
style.SQL_KEYWORD('WITH'),
|
||||
style.SQL_FIELD('1')
|
||||
|
|
|
@ -7,6 +7,13 @@ class Animal(models.Model):
|
|||
def __str__(self):
|
||||
return self.common_name
|
||||
|
||||
class Plant(models.Model):
|
||||
name = models.CharField(maxlength=150)
|
||||
|
||||
class Meta:
|
||||
# For testing when upper case letter in app name; regression for #4057
|
||||
db_table = "Fixtures_regress_plant"
|
||||
|
||||
__test__ = {'API_TESTS':"""
|
||||
>>> from django.core import management
|
||||
|
||||
|
|
Loading…
Reference in New Issue