diff options
| author | Derek Anderson <public@kered.org> | 2007-08-02 21:17:23 +0000 |
|---|---|---|
| committer | Derek Anderson <public@kered.org> | 2007-08-02 21:17:23 +0000 |
| commit | fd77e425091fdeaf321ca7658534c2f906074084 (patch) | |
| tree | ef89c6900c0b02a91f0cc610a8b65dccc7fcbf92 /django/db/backends/mysql/base.py | |
| parent | 38c1cd721dc78b17088257caff78f668315d9b25 (diff) | |
schema-evolution:
added sqlite3 unit tests
greatly expanded the number of evolutions supported by the sqlite3 backend
changed all get_<evolution_type> calls to return lists of strings
fixed sqlite3 get_indexes introspection
git-svn-id: http://code.djangoproject.com/svn/django/branches/schema-evolution@5787 bcc190cf-cafb-0310-a4f2-bffc1f526a37
Diffstat (limited to 'django/db/backends/mysql/base.py')
| -rw-r--r-- | django/db/backends/mysql/base.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/django/db/backends/mysql/base.py b/django/db/backends/mysql/base.py index ebe0c312aa..9676e09390 100644 --- a/django/db/backends/mysql/base.py +++ b/django/db/backends/mysql/base.py @@ -244,7 +244,7 @@ def get_sql_sequence_reset(style, model_list): return [] def get_change_table_name_sql( table_name, old_table_name ): - return 'ALTER TABLE '+ quote_name(old_table_name) +' RENAME TO '+ quote_name(table_name) + ';' + return ['ALTER TABLE '+ quote_name(old_table_name) +' RENAME TO '+ quote_name(table_name) + ';'] def get_change_column_name_sql( table_name, indexes, old_col_name, new_col_name, col_def ): # mysql doesn't support column renames (AFAIK), so we fake it @@ -254,7 +254,7 @@ def get_change_column_name_sql( table_name, indexes, old_col_name, new_col_name, if indexes[key]['primary_key']: pk_name = key output = [] output.append( 'ALTER TABLE '+ quote_name(table_name) +' CHANGE COLUMN '+ quote_name(old_col_name) +' '+ quote_name(new_col_name) +' '+ col_def + ';' ) - return '\n'.join(output) + return output def get_change_column_def_sql( table_name, col_name, col_type, null, unique, primary_key ): output = [] @@ -264,7 +264,7 @@ def get_change_column_def_sql( table_name, col_name, col_type, null, unique, pri if primary_key: col_def += ' '+ 'PRIMARY KEY' output.append( 'ALTER TABLE '+ quote_name(table_name) +' MODIFY COLUMN '+ quote_name(col_name) +' '+ col_def + ';' ) - return '\n'.join(output) + return output def get_add_column_sql( table_name, col_name, col_type, null, unique, primary_key ): output = [] @@ -280,7 +280,7 @@ def get_add_column_sql( table_name, col_name, col_type, null, unique, primary_ke if primary_key: field_output.append(('PRIMARY KEY')) output.append(' '.join(field_output) + ';') - return '\n'.join(output) + return output def get_drop_column_sql( table_name, col_name ): output = [] |
