summaryrefslogtreecommitdiff
path: root/django/db/backends/postgresql/base.py
diff options
context:
space:
mode:
authorDerek Anderson <public@kered.org>2007-08-01 17:51:59 +0000
committerDerek Anderson <public@kered.org>2007-08-01 17:51:59 +0000
commit0b4c2c7ab1b32d5fa1befd86207d8ead52d6e4f7 (patch)
tree69b36c684f4f35cca0effae13b7066bcb5ed7be1 /django/db/backends/postgresql/base.py
parent4629092d792a38ad493361490252b77576262f53 (diff)
schema-evolution:
fixed postgresql constraint lookup after a table rename bug pulled table renames into the backends added postgresql unit tests git-svn-id: http://code.djangoproject.com/svn/django/branches/schema-evolution@5784 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/postgresql/base.py')
-rw-r--r--django/db/backends/postgresql/base.py5
1 files changed, 5 insertions, 0 deletions
diff --git a/django/db/backends/postgresql/base.py b/django/db/backends/postgresql/base.py
index 3dd54726ea..0cf8967c7a 100644
--- a/django/db/backends/postgresql/base.py
+++ b/django/db/backends/postgresql/base.py
@@ -282,6 +282,11 @@ def typecast_string(s):
return s
return smart_unicode(s)
+def get_change_table_name_sql( table_name, old_table_name ):
+ output = []
+ output.append('ALTER TABLE '+ quote_name(old_table_name) +' RENAME TO '+ quote_name(table_name) + ';')
+ return '\n'.join(output)
+
def get_change_column_name_sql( table_name, indexes, old_col_name, new_col_name, col_def ):
# TODO: only supports a single primary key so far
pk_name = None