Преглед на файлове

HUE-2436 [desktop] Upgrade South to 1.0.2

This supports Django-1.6.x
Erick Tryzelaar преди 10 години
родител
ревизия
02721e6
променени са 100 файла, в които са добавени 254 реда и са изтрити 82 реда
  1. 0 5
      desktop/core/ext-py/South-0.8.2/setup.cfg
  2. 1 1
      desktop/core/ext-py/South-1.0.2/PKG-INFO
  3. 0 0
      desktop/core/ext-py/South-1.0.2/README
  4. 2 0
      desktop/core/ext-py/South-1.0.2/setup.cfg
  5. 0 0
      desktop/core/ext-py/South-1.0.2/setup.py
  6. 1 1
      desktop/core/ext-py/South-1.0.2/south/__init__.py
  7. 0 0
      desktop/core/ext-py/South-1.0.2/south/creator/__init__.py
  8. 0 0
      desktop/core/ext-py/South-1.0.2/south/creator/actions.py
  9. 0 0
      desktop/core/ext-py/South-1.0.2/south/creator/changes.py
  10. 0 0
      desktop/core/ext-py/South-1.0.2/south/creator/freezer.py
  11. 1 0
      desktop/core/ext-py/South-1.0.2/south/db/__init__.py
  12. 19 10
      desktop/core/ext-py/South-1.0.2/south/db/firebird.py
  13. 0 0
      desktop/core/ext-py/South-1.0.2/south/db/generic.py
  14. 15 8
      desktop/core/ext-py/South-1.0.2/south/db/mysql.py
  15. 37 18
      desktop/core/ext-py/South-1.0.2/south/db/oracle.py
  16. 0 0
      desktop/core/ext-py/South-1.0.2/south/db/postgresql_psycopg2.py
  17. 0 0
      desktop/core/ext-py/South-1.0.2/south/db/sql_server/__init__.py
  18. 0 0
      desktop/core/ext-py/South-1.0.2/south/db/sql_server/pyodbc.py
  19. 22 15
      desktop/core/ext-py/South-1.0.2/south/db/sqlite3.py
  20. 6 1
      desktop/core/ext-py/South-1.0.2/south/exceptions.py
  21. 0 0
      desktop/core/ext-py/South-1.0.2/south/hacks/__init__.py
  22. 0 0
      desktop/core/ext-py/South-1.0.2/south/hacks/django_1_0.py
  23. 0 0
      desktop/core/ext-py/South-1.0.2/south/introspection_plugins/__init__.py
  24. 0 0
      desktop/core/ext-py/South-1.0.2/south/introspection_plugins/annoying_autoonetoone.py
  25. 0 0
      desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_audit_log.py
  26. 0 0
      desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_objectpermissions.py
  27. 0 0
      desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_tagging.py
  28. 0 0
      desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_taggit.py
  29. 0 0
      desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_timezones.py
  30. 0 0
      desktop/core/ext-py/South-1.0.2/south/introspection_plugins/geodjango.py
  31. 0 0
      desktop/core/ext-py/South-1.0.2/south/logger.py
  32. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/__init__.py
  33. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/commands/__init__.py
  34. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/commands/convert_to_south.py
  35. 1 1
      desktop/core/ext-py/South-1.0.2/south/management/commands/datamigration.py
  36. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/commands/graphmigrations.py
  37. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/commands/migrate.py
  38. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/commands/migrationcheck.py
  39. 1 1
      desktop/core/ext-py/South-1.0.2/south/management/commands/schemamigration.py
  40. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/commands/startmigration.py
  41. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/commands/syncdb.py
  42. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/commands/test.py
  43. 0 0
      desktop/core/ext-py/South-1.0.2/south/management/commands/testserver.py
  44. 3 3
      desktop/core/ext-py/South-1.0.2/south/migration/__init__.py
  45. 14 3
      desktop/core/ext-py/South-1.0.2/south/migration/base.py
  46. 36 9
      desktop/core/ext-py/South-1.0.2/south/migration/migrators.py
  47. 0 0
      desktop/core/ext-py/South-1.0.2/south/migration/utils.py
  48. 6 0
      desktop/core/ext-py/South-1.0.2/south/models.py
  49. 1 0
      desktop/core/ext-py/South-1.0.2/south/modelsinspector.py
  50. 0 0
      desktop/core/ext-py/South-1.0.2/south/orm.py
  51. 3 3
      desktop/core/ext-py/South-1.0.2/south/signals.py
  52. 6 0
      desktop/core/ext-py/South-1.0.2/south/test_shim.py
  53. 1 0
      desktop/core/ext-py/South-1.0.2/south/tests/__init__.py
  54. 8 1
      desktop/core/ext-py/South-1.0.2/south/tests/autodetection.py
  55. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/__init__.py
  56. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/0001_depends_on_unmigrated.py
  57. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/0002_depends_on_unknown.py
  58. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/0003_depends_on_higher.py
  59. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/0004_higher.py
  60. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/__init__.py
  61. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/models.py
  62. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/circular_a/__init__.py
  63. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/circular_a/migrations/0001_first.py
  64. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/circular_a/migrations/__init__.py
  65. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/circular_a/models.py
  66. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/circular_b/__init__.py
  67. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/circular_b/migrations/0001_first.py
  68. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/circular_b/migrations/__init__.py
  69. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/circular_b/models.py
  70. 31 2
      desktop/core/ext-py/South-1.0.2/south/tests/db.py
  71. 39 0
      desktop/core/ext-py/South-1.0.2/south/tests/db_firebird.py
  72. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/db_mysql.py
  73. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_a/__init__.py
  74. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0001_a.py
  75. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0002_a.py
  76. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0003_a.py
  77. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0004_a.py
  78. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0005_a.py
  79. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/__init__.py
  80. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_a/models.py
  81. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_b/__init__.py
  82. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0001_b.py
  83. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0002_b.py
  84. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0003_b.py
  85. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0004_b.py
  86. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0005_b.py
  87. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/__init__.py
  88. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_b/models.py
  89. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_c/__init__.py
  90. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0001_c.py
  91. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0002_c.py
  92. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0003_c.py
  93. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0004_c.py
  94. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0005_c.py
  95. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/__init__.py
  96. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/deps_c/models.py
  97. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/emptyapp/__init__.py
  98. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/emptyapp/migrations/__init__.py
  99. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/emptyapp/models.py
  100. 0 0
      desktop/core/ext-py/South-1.0.2/south/tests/fakeapp/__init__.py

+ 0 - 5
desktop/core/ext-py/South-0.8.2/setup.cfg

@@ -1,5 +0,0 @@
-[egg_info]
-tag_build = 
-tag_date = 0
-tag_svn_revision = 0
-

+ 1 - 1
desktop/core/ext-py/South-0.8.2/PKG-INFO → desktop/core/ext-py/South-1.0.2/PKG-INFO

@@ -1,6 +1,6 @@
 Metadata-Version: 1.1
 Name: South
-Version: 0.8.2
+Version: 1.0.2
 Summary: South: Migrations for Django
 Home-page: http://south.aeracode.org/
 Author: Andrew Godwin & Andy McCurdy

+ 0 - 0
desktop/core/ext-py/South-0.8.2/README → desktop/core/ext-py/South-1.0.2/README


+ 2 - 0
desktop/core/ext-py/South-1.0.2/setup.cfg

@@ -0,0 +1,2 @@
+[wheel]
+universal = 1

+ 0 - 0
desktop/core/ext-py/South-0.8.2/setup.py → desktop/core/ext-py/South-1.0.2/setup.py


+ 1 - 1
desktop/core/ext-py/South-0.8.2/south/__init__.py → desktop/core/ext-py/South-1.0.2/south/__init__.py

@@ -2,7 +2,7 @@
 South - Useable migrations for Django apps
 """
 
-__version__ = "0.8.2"
+__version__ = "1.0.2"
 __authors__ = [
     "Andrew Godwin <andrew@aeracode.org>",
     "Andy McCurdy <andy@andymccurdy.com>"

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/creator/__init__.py → desktop/core/ext-py/South-1.0.2/south/creator/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/creator/actions.py → desktop/core/ext-py/South-1.0.2/south/creator/actions.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/creator/changes.py → desktop/core/ext-py/South-1.0.2/south/creator/changes.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/creator/freezer.py → desktop/core/ext-py/South-1.0.2/south/creator/freezer.py


+ 1 - 0
desktop/core/ext-py/South-0.8.2/south/db/__init__.py → desktop/core/ext-py/South-1.0.2/south/db/__init__.py

@@ -23,6 +23,7 @@ engine_modules = {
     'doj.backends.zxjdbc.postgresql': 'postgresql_psycopg2', #django-jython
     'doj.backends.zxjdbc.mysql': 'mysql', #django-jython
     'doj.backends.zxjdbc.oracle': 'oracle', #django-jython
+    'mysql.connector.django': 'mysql', # MySQL Connector/Python
 }
 
 # First, work out if we're multi-db or not, and which databases we have

+ 19 - 10
desktop/core/ext-py/South-0.8.2/south/db/firebird.py → desktop/core/ext-py/South-1.0.2/south/db/firebird.py

@@ -81,11 +81,13 @@ class DatabaseOperations(generic.DatabaseOperations):
 
     @generic.invalidate_table_constraints
     def create_table(self, table_name, fields):
-        qn = self.quote_name(table_name)
         columns = []
         autoinc_sql = ''
 
         for field_name, field in fields:
+            # avoid default values in CREATE TABLE statements (#925)
+            field._suppress_default = True
+            
             col = self.column_sql(table_name, field_name, field)
             if not col:
                 continue
@@ -95,8 +97,11 @@ class DatabaseOperations(generic.DatabaseOperations):
                 field_name = field.db_column or field.column
                 autoinc_sql = connection.ops.autoinc_sql(table_name, field_name)
 
-        sql = 'CREATE TABLE %s (%s);' % (qn, ', '.join([col for col in columns]))
-        self.execute(sql)
+        self.execute(self.create_table_sql % {
+            "table": self.quote_name(table_name),
+            "columns": ', '.join([col for col in columns if col]),
+        })
+        
         if autoinc_sql:
             self.execute(autoinc_sql[0])
             self.execute(autoinc_sql[1])
@@ -210,13 +215,17 @@ class DatabaseOperations(generic.DatabaseOperations):
             for stmt in field.post_create_sql(no_style(), table_name):
                 self.add_deferred_sql(stmt)
 
-        # In 1.2 and above, you have to ask the DatabaseCreation stuff for it.
-        # This also creates normal indexes in 1.1.
-        if hasattr(self._get_connection().creation, "sql_indexes_for_field"):
-            # Make a fake model to pass in, with only db_table
-            model = self.mock_model("FakeModelForGISCreation", table_name)
-            for stmt in self._get_connection().creation.sql_indexes_for_field(model, field, no_style()):
-                self.add_deferred_sql(stmt)
+        # Avoid double index creation (#1317)
+        # Firebird creates an index implicity for each foreign key field 
+        # sql_indexes_for_field tries to create an index for that field too
+        if not field.rel:
+            # In 1.2 and above, you have to ask the DatabaseCreation stuff for it.
+            # This also creates normal indexes in 1.1.
+            if hasattr(self._get_connection().creation, "sql_indexes_for_field"):
+                # Make a fake model to pass in, with only db_table
+                model = self.mock_model("FakeModelForGISCreation", table_name)
+                for stmt in self._get_connection().creation.sql_indexes_for_field(model, field, no_style()):
+                    self.add_deferred_sql(stmt)
 
         if sql:
             return sql % sqlparams

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/db/generic.py → desktop/core/ext-py/South-1.0.2/south/db/generic.py


+ 15 - 8
desktop/core/ext-py/South-0.8.2/south/db/mysql.py → desktop/core/ext-py/South-1.0.2/south/db/mysql.py

@@ -37,13 +37,16 @@ def copy_column_constraints(func):
     def _column_cp(self, table_name, column_old, column_new, *args, **opts):
         # Copy foreign key constraint
         try:
-            constraint = self._find_foreign_constraints(table_name, column_old)[0]
-            (ftable, fcolumn) = self._lookup_constraint_references(table_name, constraint)
-            if ftable and fcolumn:
-                fk_sql = self.foreign_key_sql(
-                            table_name, column_new, ftable, fcolumn)
-                get_logger().debug("Foreign key SQL: " + fk_sql)
-                self.add_deferred_sql(fk_sql)
+            constraint = self._find_foreign_constraints(
+                table_name, column_old)[0]
+            refs = self._lookup_constraint_references(table_name, constraint)
+            if refs is not None:
+                (ftable, fcolumn) = refs
+                if ftable and fcolumn:
+                    fk_sql = self.foreign_key_sql(
+                        table_name, column_new, ftable, fcolumn)
+                    get_logger().debug("Foreign key SQL: " + fk_sql)
+                    self.add_deferred_sql(fk_sql)
         except IndexError:
             pass  # No constraint exists so ignore
         except DryRunError:
@@ -178,8 +181,12 @@ class DatabaseOperations(generic.DatabaseOperations):
         e.g. which storage engine (MySQL) or transaction serialisability level.
         """
         cursor = self._get_connection().cursor()
+        if cursor.execute("SHOW variables WHERE Variable_Name='default_storage_engine';"):
+            engine_var = 'default_storage_engine'
+        else:
+            engine_var = 'storage_engine'
         if self._has_setting('STORAGE_ENGINE') and self._get_setting('STORAGE_ENGINE'):
-            cursor.execute("SET storage_engine=%s;" % self._get_setting('STORAGE_ENGINE'))
+            cursor.execute("SET %s=%s;" % (engine_var, self._get_setting('STORAGE_ENGINE')))
 
     def start_transaction(self):
         super(DatabaseOperations, self).start_transaction()

+ 37 - 18
desktop/core/ext-py/South-0.8.2/south/db/oracle.py → desktop/core/ext-py/South-1.0.2/south/db/oracle.py

@@ -87,11 +87,11 @@ class DatabaseOperations(generic.DatabaseOperations):
         for field_name, field in fields:
             
             field = self._field_sanity(field)
-
+
             # avoid default values in CREATE TABLE statements (#925)
             field._suppress_default = True
 
-
+
             col = self.column_sql(table_name, field_name, field)
             if not col:
                 continue
@@ -132,7 +132,7 @@ END;
         self.execute(sequence_sql)
 
     @generic.invalidate_table_constraints
-    def alter_column(self, table_name, name, field, explicit_name=True):
+    def alter_column(self, table_name, name, field, explicit_name=True, ignore_constraints=False):
         
         if self.dry_run:
             if self.debug:
@@ -162,7 +162,7 @@ END;
             'nullity': 'NOT NULL',
             'default': 'NULL'
         }
-        if field.null:
+        if field.null:
             params['nullity'] = 'NULL'
 
         sql_templates = [
@@ -184,15 +184,21 @@ END;
                 (self.alter_string_update_nulls_to_default, change_params(default="%s"), [field.get_default()]),
             ]
 
-
-        # drop CHECK constraints. Make sure this is executed before the ALTER TABLE statements
-        # generated above, since those statements recreate the constraints we delete here.
-        check_constraints = self._constraints_affecting_columns(table_name, [name], "CHECK")
-        for constraint in check_constraints:
-            self.execute(self.delete_check_sql % {
-                'table': self.quote_name(table_name),
-                'constraint': self.quote_name(constraint),
-            })
+        if not ignore_constraints:
+            # drop CHECK constraints. Make sure this is executed before the ALTER TABLE statements
+            # generated above, since those statements recreate the constraints we delete here.
+            check_constraints = self._constraints_affecting_columns(table_name, [name], "CHECK")
+            for constraint in check_constraints:
+                self.execute(self.delete_check_sql % {
+                    'table': self.quote_name(table_name),
+                    'constraint': self.quote_name(constraint),
+                })
+            # Drop foreign constraints
+            try:
+                self.delete_foreign_key(qn, qn_col)
+            except ValueError:
+                # There weren't any
+                pass
 
         for sql_template, params, args in sql_templates:
             try:
@@ -214,6 +220,19 @@ END;
                     self._print_sql_error(exc, sql_template % params)
                     raise
 
+        if not ignore_constraints:
+            # Add back FK constraints if needed
+            if field.rel: #and self.supports_foreign_keys:
+                self.add_deferred_sql(
+                    self.foreign_key_sql(
+                        qn[1:-1],      # foreign_key_sql uses this as part of constraint name
+                        qn_col[1:-1],  # foreign_key_sql uses this as part of constraint name
+                        field.rel.to._meta.db_table,
+                        field.rel.to._meta.get_field(field.rel.field_name).column
+                    )
+                )
+
+
     def _alter_column_lob_workaround(self, table_name, name, field):
         """
         Oracle refuses to change a column type from/to LOB to/from a regular
@@ -266,9 +285,9 @@ END;
             self.execute(sql)
 
             # Now, drop the default if we need to
-            if not keep_default and field.default is not None:
+            if field.default is not None:
                 field.default = NOT_PROVIDED
-                self.alter_column(table_name, name, field, explicit_name=False)
+                self.alter_column(table_name, name, field, explicit_name=False, ignore_constraints=True)
 
     def delete_column(self, table_name, name):
         return super(DatabaseOperations, self).delete_column(self.quote_name(table_name), name)
@@ -292,11 +311,11 @@ END;
         """
         if isinstance(field, models.BooleanField) and field.has_default():
             field.default = int(field.to_python(field.get_default()))
-        # On Oracle, empty strings are null
-        if isinstance(field, (models.CharField, models.TextField)):
+        # On Oracle, empty strings are null
+        if isinstance(field, (models.CharField, models.TextField)):
             field.null = field.empty_strings_allowed
         return field
-
+
 
     def _default_value_workaround(self, value):
         from datetime import date,time,datetime

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/db/postgresql_psycopg2.py → desktop/core/ext-py/South-1.0.2/south/db/postgresql_psycopg2.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/db/sql_server/__init__.py → desktop/core/ext-py/South-1.0.2/south/db/sql_server/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/db/sql_server/pyodbc.py → desktop/core/ext-py/South-1.0.2/south/db/sql_server/pyodbc.py


+ 22 - 15
desktop/core/ext-py/South-0.8.2/south/db/sqlite3.py → desktop/core/ext-py/South-1.0.2/south/db/sqlite3.py

@@ -64,7 +64,7 @@ class DatabaseOperations(generic.DatabaseOperations):
         cursor = self._get_connection().cursor()
         # Get the index descriptions
         indexes = self._get_connection().introspection.get_indexes(cursor, table_name)
-        multi_indexes = self._get_multi_indexes(table_name)
+        standalone_indexes = self._get_standalone_indexes(table_name)
         # Work out new column defs.
         for column_info in self._get_full_table_description(self._get_connection(), cursor, table_name):
             name = column_info['name']
@@ -117,8 +117,9 @@ class DatabaseOperations(generic.DatabaseOperations):
         # Recreate multi-valued indexes
         # We can't do that before since it's impossible to rename indexes
         # and index name scope is global
-        self._make_multi_indexes(table_name, multi_indexes, renames=renames, deleted=deleted, uniques_deleted=uniques_deleted)
-    
+        self._make_standalone_indexes(table_name, standalone_indexes, renames=renames, deleted=deleted, uniques_deleted=uniques_deleted)
+        self.deferred_sql = [] # prevent double indexing
+
     def _copy_data(self, src, dst, field_renames={}, added={}):
         "Used to copy data into a new table"
         # Make a list of all the fields to select
@@ -149,32 +150,38 @@ class DatabaseOperations(generic.DatabaseOperations):
         ))
 
     def _create_unique(self, table_name, columns):
-        self.execute("CREATE UNIQUE INDEX %s ON %s(%s);" % (
-            self.quote_name('%s_%s' % (table_name, '__'.join(columns))),
+        self._create_index(table_name, columns, True)
+
+    def _create_index(self, table_name, columns, unique=False, index_name=None):
+        if index_name is None:
+            index_name = '%s_%s' % (table_name, '__'.join(columns))
+        self.execute("CREATE %sINDEX %s ON %s(%s);" % (
+            unique and "UNIQUE " or "",
+            self.quote_name(index_name),
             self.quote_name(table_name),
             ', '.join(self.quote_name(c) for c in columns),
         ))
 
-    def _get_multi_indexes(self, table_name):
+    def _get_standalone_indexes(self, table_name):
         indexes = []
         cursor = self._get_connection().cursor()
         cursor.execute('PRAGMA index_list(%s)' % self.quote_name(table_name))
         # seq, name, unique
         for index, unique in [(field[1], field[2]) for field in cursor.fetchall()]:
-            if not unique:
-                continue
             cursor.execute('PRAGMA index_info(%s)' % self.quote_name(index))
             info = cursor.fetchall()
-            if len(info) == 1:
+            if len(info) == 1 and unique:
+                # This index is already specified in the CREATE TABLE columns
+                # specification
                 continue
             columns = []
             for field in info:
                 columns.append(field[2])
-            indexes.append(columns)
+            indexes.append((index, columns, unique))
         return indexes
 
-    def _make_multi_indexes(self, table_name, indexes, deleted=[], renames={}, uniques_deleted=[]):
-        for index in indexes:
+    def _make_standalone_indexes(self, table_name, indexes, deleted=[], renames={}, uniques_deleted=[]):
+        for index_name, index, unique in indexes:
             columns = []
 
             for name in index:
@@ -188,9 +195,9 @@ class DatabaseOperations(generic.DatabaseOperations):
                     name = renames[name]
                 columns.append(name)
 
-            if columns and set(columns) != set(uniques_deleted):
-                self._create_unique(table_name, columns)
-    
+            if columns and (set(columns) != set(uniques_deleted) or not unique):
+                self._create_index(table_name, columns, unique, index_name)
+
     def _column_sql_for_create(self, table_name, name, field, explicit_name=True):
         "Given a field and its name, returns the full type for the CREATE TABLE (without unique/pk)"
         field.set_attributes_from_name(name)

+ 6 - 1
desktop/core/ext-py/South-0.8.2/south/exceptions.py → desktop/core/ext-py/South-1.0.2/south/exceptions.py

@@ -15,7 +15,10 @@ class BrokenMigration(SouthError):
         if self.exc_info:
             self.traceback = ''.join(format_exception(*self.exc_info))
         else:
-            self.traceback = format_exc()
+            try:
+                self.traceback = format_exc()
+            except AttributeError: # Python3 when there is no previous exception
+                self.traceback = None
 
     def __str__(self):
         return ("While loading migration '%(migration)s':\n"
@@ -24,6 +27,8 @@ class BrokenMigration(SouthError):
 
 class UnknownMigration(BrokenMigration):
     def __str__(self):
+        if not hasattr(self, "traceback"):
+            self.traceback = ""
         return ("Migration '%(migration)s' probably doesn't exist.\n"
                 '%(traceback)s' % self.__dict__)
 

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/hacks/__init__.py → desktop/core/ext-py/South-1.0.2/south/hacks/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/hacks/django_1_0.py → desktop/core/ext-py/South-1.0.2/south/hacks/django_1_0.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/introspection_plugins/__init__.py → desktop/core/ext-py/South-1.0.2/south/introspection_plugins/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/introspection_plugins/annoying_autoonetoone.py → desktop/core/ext-py/South-1.0.2/south/introspection_plugins/annoying_autoonetoone.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/introspection_plugins/django_audit_log.py → desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_audit_log.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/introspection_plugins/django_objectpermissions.py → desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_objectpermissions.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/introspection_plugins/django_tagging.py → desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_tagging.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/introspection_plugins/django_taggit.py → desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_taggit.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/introspection_plugins/django_timezones.py → desktop/core/ext-py/South-1.0.2/south/introspection_plugins/django_timezones.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/introspection_plugins/geodjango.py → desktop/core/ext-py/South-1.0.2/south/introspection_plugins/geodjango.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/logger.py → desktop/core/ext-py/South-1.0.2/south/logger.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/__init__.py → desktop/core/ext-py/South-1.0.2/south/management/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/commands/__init__.py → desktop/core/ext-py/South-1.0.2/south/management/commands/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/commands/convert_to_south.py → desktop/core/ext-py/South-1.0.2/south/management/commands/convert_to_south.py


+ 1 - 1
desktop/core/ext-py/South-0.8.2/south/management/commands/datamigration.py → desktop/core/ext-py/South-1.0.2/south/management/commands/datamigration.py

@@ -116,7 +116,7 @@ class Command(BaseCommand):
 
 
 MIGRATION_TEMPLATE = """# -*- coding: utf-8 -*-
-import datetime
+from south.utils import datetime_utils as datetime
 from south.db import db
 from south.v2 import DataMigration
 from django.db import models

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/commands/graphmigrations.py → desktop/core/ext-py/South-1.0.2/south/management/commands/graphmigrations.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/commands/migrate.py → desktop/core/ext-py/South-1.0.2/south/management/commands/migrate.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/commands/migrationcheck.py → desktop/core/ext-py/South-1.0.2/south/management/commands/migrationcheck.py


+ 1 - 1
desktop/core/ext-py/South-0.8.2/south/management/commands/schemamigration.py → desktop/core/ext-py/South-1.0.2/south/management/commands/schemamigration.py

@@ -210,7 +210,7 @@ class Command(DataCommand):
 
 
 MIGRATION_TEMPLATE = """# -*- coding: utf-8 -*-
-import datetime
+from south.utils import datetime_utils as datetime
 from south.db import db
 from south.v2 import SchemaMigration
 from django.db import models

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/commands/startmigration.py → desktop/core/ext-py/South-1.0.2/south/management/commands/startmigration.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/commands/syncdb.py → desktop/core/ext-py/South-1.0.2/south/management/commands/syncdb.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/commands/test.py → desktop/core/ext-py/South-1.0.2/south/management/commands/test.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/management/commands/testserver.py → desktop/core/ext-py/South-1.0.2/south/management/commands/testserver.py


+ 3 - 3
desktop/core/ext-py/South-0.8.2/south/migration/__init__.py → desktop/core/ext-py/South-1.0.2/south/migration/__init__.py

@@ -162,7 +162,7 @@ def migrate_app(migrations, target_name=None, merge=False, fake=False, db_dry_ru
 
     verbosity = int(verbosity)
     # Fire off the pre-migrate signal
-    pre_migrate.send(None, app=app_label)
+    pre_migrate.send(None, app=app_label, verbosity=verbosity, interactive=verbosity, db=database)
     
     # If there aren't any, quit quizically
     if not migrations:
@@ -220,7 +220,7 @@ def migrate_app(migrations, target_name=None, merge=False, fake=False, db_dry_ru
         success = migrator.migrate_many(target, workplan, database)
         # Finally, fire off the post-migrate signal
         if success:
-            post_migrate.send(None, app=app_label)
+            post_migrate.send(None, app=app_label, verbosity=verbosity, interactive=verbosity, db=database)
     else:
         if verbosity:
             # Say there's nothing.
@@ -232,4 +232,4 @@ def migrate_app(migrations, target_name=None, merge=False, fake=False, db_dry_ru
             migrator = LoadInitialDataMigrator(migrator=Forwards(verbosity=verbosity))
             migrator.load_initial_data(target, db=database)
         # Send signal.
-        post_migrate.send(None, app=app_label)
+        post_migrate.send(None, app=app_label, verbosity=verbosity, interactive=verbosity, db=database)

+ 14 - 3
desktop/core/ext-py/South-0.8.2/south/migration/base.py → desktop/core/ext-py/South-1.0.2/south/migration/base.py

@@ -138,7 +138,15 @@ class Migrations(with_metaclass(MigrationsMetaclass, list)):
             if app_label in settings.SOUTH_MIGRATION_MODULES:
                 # There's an override.
                 return settings.SOUTH_MIGRATION_MODULES[app_label]
-        return self._application.__name__ + '.migrations'
+        # We see if the south_migrations module exists first, and
+        # use that if we find it.
+        module_name = self._application.__name__ + '.south_migrations'
+        try:
+            importlib.import_module(module_name)
+        except ImportError:
+            return self._application.__name__ + '.migrations'
+        else:
+            return module_name
 
     def get_application(self):
         return self._application
@@ -149,7 +157,7 @@ class Migrations(with_metaclass(MigrationsMetaclass, list)):
         Imports the migrations module object, and throws a paddy if it can't.
         """
         self._application = application
-        if not hasattr(application, 'migrations'):
+        if not hasattr(application, 'migrations') and not hasattr(application, 'south_migrations'):
             try:
                 module = importlib.import_module(self.migrations_module())
                 self._migrations = application.migrations = module
@@ -160,7 +168,10 @@ class Migrations(with_metaclass(MigrationsMetaclass, list)):
                     self._migrations = application.migrations = module
                 else:
                     raise exceptions.NoMigrations(application)
-        self._load_migrations_module(application.migrations)
+        if hasattr(application, 'south_migrations'):
+            self._load_migrations_module(application.south_migrations)
+        else:
+            self._load_migrations_module(application.migrations)
 
     application = property(get_application, set_application)
 

+ 36 - 9
desktop/core/ext-py/South-0.8.2/south/migration/migrators.py → desktop/core/ext-py/South-1.0.2/south/migration/migrators.py

@@ -9,13 +9,14 @@ import traceback
 from django.core.management import call_command
 from django.core.management.commands import loaddata
 from django.db import models
+from django import VERSION as DJANGO_VERSION
 
 import south.db
 from south import exceptions
 from south.db import DEFAULT_DB_ALIAS
 from south.models import MigrationHistory
 from south.signals import ran_migration
-from south.utils.py3 import StringIO
+from south.utils.py3 import StringIO, iteritems
 
 
 class Migrator(object):
@@ -30,7 +31,7 @@ class Migrator(object):
     def print_title(self, target):
         if self.verbosity:
             print(self.title(target))
-        
+
     @staticmethod
     def status(target):
         raise NotImplementedError()
@@ -98,7 +99,7 @@ class Migrator(object):
             except:
                 print("Error during commit in migration: %s" % migration)
                 raise
-                
+
 
     def run(self, migration, database):
         # Get the correct ORM.
@@ -113,11 +114,14 @@ class Migrator(object):
         return self.run_migration(migration, database)
 
 
-    def send_ran_migration(self, migration):
+    def send_ran_migration(self, migration, database):
         ran_migration.send(None,
                            app=migration.app_label(),
                            migration=migration,
-                           method=self.__class__.__name__.lower())
+                           method=self.__class__.__name__.lower(),
+                           verbosity=self.verbosity,
+                           interactive=self.interactive,
+                           db=database)
 
     def migrate(self, migration, database):
         """
@@ -127,7 +131,7 @@ class Migrator(object):
         migration_name = migration.name()
         self.print_status(migration)
         result = self.run(migration, database)
-        self.send_ran_migration(migration)
+        self.send_ran_migration(migration, database)
         return result
 
     def migrate_many(self, target, migrations, database):
@@ -157,7 +161,8 @@ class DryRunMigrator(MigratorWrapper):
             if self.verbosity:
                 print(" - Migration '%s' is marked for no-dry-run." % migration)
             return
-        south.db.db.dry_run = True
+        for name, db in iteritems(south.db.dbs):
+            south.db.dbs[name].dry_run = True
         # preserve the constraint cache as it can be mutated by the dry run
         constraint_cache = deepcopy(south.db.db._constraint_cache)
         if self._ignore_fail:
@@ -176,7 +181,8 @@ class DryRunMigrator(MigratorWrapper):
             if self._ignore_fail:
                 south.db.db.debug = old_debug
             south.db.db.clear_run_data(pending_creates)
-            south.db.db.dry_run = False
+            for name, db in iteritems(south.db.dbs):
+                south.db.dbs[name].dry_run = False
             # restore the preserved constraint cache from before dry run was
             # executed
             south.db.db._constraint_cache = constraint_cache
@@ -205,13 +211,19 @@ class FakeMigrator(MigratorWrapper):
 
 
 class LoadInitialDataMigrator(MigratorWrapper):
-    
+
     def load_initial_data(self, target, db='default'):
         if target is None or target != target.migrations[-1]:
             return
         # Load initial data, if we ended up at target
         if self.verbosity:
             print(" - Loading initial data for %s." % target.app_label())
+        if DJANGO_VERSION < (1, 6):
+            self.pre_1_6(target, db)
+        else:
+            self.post_1_6(target, db)
+
+    def pre_1_6(self, target, db):
         # Override Django's get_apps call temporarily to only load from the
         # current app
         old_get_apps = models.get_apps
@@ -224,6 +236,21 @@ class LoadInitialDataMigrator(MigratorWrapper):
             models.get_apps = old_get_apps
             loaddata.get_apps = old_get_apps
 
+    def post_1_6(self, target, db):
+        import django.db.models.loading
+        ## build a new 'AppCache' object with just the app we care about.
+        old_cache = django.db.models.loading.cache
+        new_cache = django.db.models.loading.AppCache()
+        new_cache.get_apps = lambda: [new_cache.get_app(target.app_label())]
+
+        ## monkeypatch
+        django.db.models.loading.cache = new_cache
+        try:
+            call_command('loaddata', 'initial_data', verbosity=self.verbosity, database=db)
+        finally:
+            ## unmonkeypatch
+            django.db.models.loading.cache = old_cache
+
     def migrate_many(self, target, migrations, database):
         migrator = self._migrator
         result = migrator.__class__.migrate_many(migrator, target, migrations, database)

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/migration/utils.py → desktop/core/ext-py/South-1.0.2/south/migration/utils.py


+ 6 - 0
desktop/core/ext-py/South-0.8.2/south/models.py → desktop/core/ext-py/South-1.0.2/south/models.py

@@ -1,6 +1,12 @@
 from django.db import models
 from south.db import DEFAULT_DB_ALIAS
 
+# If we detect Django 1.7 or higher, then exit
+# Placed here so it's guaranteed to be imported on Django start
+import django
+if django.VERSION[0] > 1 or (django.VERSION[0] == 1 and django.VERSION[1] > 6):
+    raise RuntimeError("South does not support Django 1.7 or higher. Please use native Django migrations.")
+
 class MigrationHistory(models.Model):
     app_name = models.CharField(max_length=255)
     migration = models.CharField(max_length=255)

+ 1 - 0
desktop/core/ext-py/South-0.8.2/south/modelsinspector.py → desktop/core/ext-py/South-1.0.2/south/modelsinspector.py

@@ -164,6 +164,7 @@ allowed_fields = [
     "^django\.db",
     "^django\.contrib\.contenttypes\.generic",
     "^django\.contrib\.localflavor",
+    "^django_localflavor_\w\w",
 ]
 
 # Regexes of ignored fields (custom fields which look like fields, but have no column behind them)

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/orm.py → desktop/core/ext-py/South-1.0.2/south/orm.py


+ 3 - 3
desktop/core/ext-py/South-0.8.2/south/signals.py → desktop/core/ext-py/South-1.0.2/south/signals.py

@@ -6,13 +6,13 @@ from django.dispatch import Signal
 from django.conf import settings
 
 # Sent at the start of the migration of an app
-pre_migrate = Signal(providing_args=["app"])
+pre_migrate = Signal(providing_args=["app", "verbosity", "interactive", "db"])
 
 # Sent after each successful migration of an app
-post_migrate = Signal(providing_args=["app"])
+post_migrate = Signal(providing_args=["app", "verbosity", "interactive", "db"])
 
 # Sent after each run of a particular migration in a direction
-ran_migration = Signal(providing_args=["app","migration","method"])
+ran_migration = Signal(providing_args=["app", "migration", "method", "verbosity", "interactive", "db"])
 
 # Compatibility code for django.contrib.auth
 # Is causing strange errors, removing for now (we might need to fix up orm first)

+ 6 - 0
desktop/core/ext-py/South-1.0.2/south/test_shim.py

@@ -0,0 +1,6 @@
+"""
+This file is needed as 1.6 only finds tests in files labelled test_*,
+and ignores tests/__init__.py.
+"""
+
+from south.tests import *

+ 1 - 0
desktop/core/ext-py/South-0.8.2/south/tests/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/__init__.py

@@ -101,6 +101,7 @@ except:
 if not skiptest:
     from south.tests.db import *
     from south.tests.db_mysql import *
+    from south.tests.db_firebird import *
     from south.tests.logic import *
     from south.tests.autodetection import *
     from south.tests.logger import *

+ 8 - 1
desktop/core/ext-py/South-0.8.2/south/tests/autodetection.py → desktop/core/ext-py/South-1.0.2/south/tests/autodetection.py

@@ -7,6 +7,12 @@ from south.creator import freezer
 from south.orm import FakeORM
 from south.v2 import SchemaMigration
 
+try:
+    from django.utils.six.moves import reload_module
+except ImportError:
+    # Older django, no python3 support
+    reload_module = reload
+
 class TestComparison(unittest.TestCase):
     
     """
@@ -338,7 +344,8 @@ class TestNonManagedIgnored(Monkeypatcher):
 
             complete_apps = ['non_managed']
                     
-        from non_managed import models as dummy_import_to_force_loading_models # TODO: Does needing this indicate a bug in MokeyPatcher? 
+        from non_managed import models as dummy_import_to_force_loading_models # TODO: Does needing this indicate a bug in MokeyPatcher?
+        reload_module(dummy_import_to_force_loading_models) # really force... 
         
         migrations = Migrations("non_managed")
         initial_orm = FakeORM(InitialMigration, "non_managed")

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/brokenapp/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/brokenapp/migrations/0001_depends_on_unmigrated.py → desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/0001_depends_on_unmigrated.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/brokenapp/migrations/0002_depends_on_unknown.py → desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/0002_depends_on_unknown.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/brokenapp/migrations/0003_depends_on_higher.py → desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/0003_depends_on_higher.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/brokenapp/migrations/0004_higher.py → desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/0004_higher.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/brokenapp/migrations/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/migrations/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/brokenapp/models.py → desktop/core/ext-py/South-1.0.2/south/tests/brokenapp/models.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/circular_a/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/circular_a/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/circular_a/migrations/0001_first.py → desktop/core/ext-py/South-1.0.2/south/tests/circular_a/migrations/0001_first.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/circular_a/migrations/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/circular_a/migrations/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/circular_a/models.py → desktop/core/ext-py/South-1.0.2/south/tests/circular_a/models.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/circular_b/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/circular_b/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/circular_b/migrations/0001_first.py → desktop/core/ext-py/South-1.0.2/south/tests/circular_b/migrations/0001_first.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/circular_b/migrations/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/circular_b/migrations/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/circular_b/models.py → desktop/core/ext-py/South-1.0.2/south/tests/circular_b/models.py


+ 31 - 2
desktop/core/ext-py/South-0.8.2/south/tests/db.py → desktop/core/ext-py/South-1.0.2/south/tests/db.py

@@ -762,8 +762,9 @@ class TestOperations(unittest.TestCase):
             ('spam', models.BooleanField(default=False))
         ])
         
-        db.add_column("test_add_unique_fk", "mock1", models.ForeignKey(db.mock_model('Mock', 'mock'), null=True, unique=True))
-        db.add_column("test_add_unique_fk", "mock2", models.OneToOneField(db.mock_model('Mock', 'mock'), null=True))
+        db.add_column("test_add_unique_fk", "mock1", models.ForeignKey(db.mock_model('User', 'auth_user'), null=True, unique=True))
+        db.add_column("test_add_unique_fk", "mock2", models.OneToOneField(db.mock_model('User', 'auth_user'), null=True))
+        db.execute_deferred_sql()
         
         db.delete_table("test_add_unique_fk")
         
@@ -879,6 +880,34 @@ class TestOperations(unittest.TestCase):
         db.alter_column("test_make_fk_null", "foreik_id", models.ForeignKey(User, null=True))
         db.execute_deferred_sql()
 
+    def test_change_foreign_key_target(self):
+        # Tables for FK to target
+        User = db.mock_model(model_name='User', db_table='auth_user', db_tablespace='', pk_field_name='id', pk_field_type=models.AutoField, pk_field_args=[], pk_field_kwargs={})
+        db.create_table("test_fk_changed_target", [
+            ('eggs', models.IntegerField(primary_key=True)),
+        ])
+        Egg = db.mock_model(model_name='Egg', db_table='test_fk_changed_target', db_tablespace='', pk_field_name='eggs', pk_field_type=models.AutoField, pk_field_args=[], pk_field_kwargs={})
+        # Table with a foreign key to the wrong table
+        db.create_table("test_fk_changing", [
+            ('egg', models.ForeignKey(User, null=True)),
+        ])
+        db.execute_deferred_sql()
+
+        # Change foreign key pointing
+        db.alter_column("test_fk_changing", "egg_id", models.ForeignKey(Egg, null=True))
+        db.execute_deferred_sql()
+
+        # Test that it is pointing at the right table now
+        try:
+            non_user_id = db.execute("SELECT MAX(id) FROM auth_user")[0][0] + 1
+        except (TypeError, IndexError):
+            # Got a "None" or no records, treat as 0
+            non_user_id = 17
+        db.execute("INSERT INTO test_fk_changed_target (eggs) VALUES (%s)", [non_user_id])
+        db.execute("INSERT INTO test_fk_changing (egg_id) VALUES (%s)", [non_user_id])
+        db.commit_transaction()
+        db.start_transaction()  # The test framework expects tests to end in transaction
+
     def test_alter_double_indexed_column(self):
         # Table for FK to target
         User = db.mock_model(model_name='User', db_table='auth_user', db_tablespace='', pk_field_name='id', pk_field_type=models.AutoField, pk_field_args=[], pk_field_kwargs={})

+ 39 - 0
desktop/core/ext-py/South-1.0.2/south/tests/db_firebird.py

@@ -0,0 +1,39 @@
+from django.db import models
+
+from south.db import db
+from south.tests import unittest, skipUnless
+
+
+class FirebirdTests(unittest.TestCase):
+
+    """
+    Tests firebird related issues
+    """
+
+    def setUp(self):
+        print('=' * 80)
+        print('Begin Firebird test')
+
+    def tearDown(self):
+        print('End Firebird test')
+        print('=' * 80)
+
+    @skipUnless(db.backend_name == "firebird", "Firebird-only test")
+    def test_firebird_double_index_creation_1317(self):
+        """
+        Tests foreign key creation, especially uppercase (see #61)
+        """
+        Test = db.mock_model(model_name='Test',
+            db_table='test5a',
+            db_tablespace='',
+            pk_field_name='ID',
+            pk_field_type=models.AutoField,
+            pk_field_args=[]
+        )
+        db.create_table("test5a", [('ID', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True))])
+        db.create_table("test5b", [
+            ('id', models.AutoField(verbose_name='ID', primary_key=True, auto_created=True)),
+            ('UNIQUE', models.ForeignKey(Test)),
+        ])
+        db.execute_deferred_sql()
+

+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/db_mysql.py → desktop/core/ext-py/South-1.0.2/south/tests/db_mysql.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_a/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_a/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_a/migrations/0001_a.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0001_a.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_a/migrations/0002_a.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0002_a.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_a/migrations/0003_a.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0003_a.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_a/migrations/0004_a.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0004_a.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_a/migrations/0005_a.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/0005_a.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_a/migrations/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_a/migrations/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_a/models.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_a/models.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_b/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_b/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_b/migrations/0001_b.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0001_b.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_b/migrations/0002_b.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0002_b.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_b/migrations/0003_b.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0003_b.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_b/migrations/0004_b.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0004_b.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_b/migrations/0005_b.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/0005_b.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_b/migrations/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_b/migrations/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_b/models.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_b/models.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_c/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_c/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_c/migrations/0001_c.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0001_c.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_c/migrations/0002_c.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0002_c.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_c/migrations/0003_c.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0003_c.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_c/migrations/0004_c.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0004_c.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_c/migrations/0005_c.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/0005_c.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_c/migrations/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_c/migrations/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/deps_c/models.py → desktop/core/ext-py/South-1.0.2/south/tests/deps_c/models.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/emptyapp/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/emptyapp/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/emptyapp/migrations/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/emptyapp/migrations/__init__.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/emptyapp/models.py → desktop/core/ext-py/South-1.0.2/south/tests/emptyapp/models.py


+ 0 - 0
desktop/core/ext-py/South-0.8.2/south/tests/fakeapp/__init__.py → desktop/core/ext-py/South-1.0.2/south/tests/fakeapp/__init__.py


Някои файлове не бяха показани, защото твърде много файлове са промени