diff -r c2f9a062d54f south/db/sqlite3.py
|
a
|
b
|
|
| 85 | 85 | # Make a list of all the fields to select |
| 86 | 86 | cursor = self._get_connection().cursor() |
| 87 | 87 | q_fields = [column_info[0] for column_info in self._get_connection().introspection.get_table_description(cursor, dst)] |
| 88 | | # Make sure renames are done correctly |
| | 88 | new_to_old = {} |
| 89 | 89 | for old, new in field_renames.items(): |
| 90 | | q_fields[q_fields.index(new)] = "%s AS %s" % (old, self.quote_name(new)) |
| | 90 | new_to_old[new] = old |
| | 91 | q_fields_new = [] |
| | 92 | for field in q_fields: |
| | 93 | if field in new_to_old: |
| | 94 | # Make sure renames are done correctly |
| | 95 | q_fields_new.append("%s AS %s" % (self.quote_name(new_to_old[field]), self.quote_name(field))) |
| | 96 | else: |
| | 97 | q_fields_new.append(self.quote_name(field)) |
| | 98 | q_fields = q_fields_new |
| 91 | 99 | # Copy over the data |
| 92 | 100 | self.execute("INSERT INTO %s SELECT %s FROM %s;" % ( |
| 93 | 101 | self.quote_name(dst), |