python - Django south illogical error -
so using south django project, , have been changing model logic. changed bunch of things, regardless, model looks now:
class group(models.model): '''table of organizational groups''' group_id = models.autofield(primary_key=true) group_name = models.charfield(max_length=100,unique=true) #name of group string icon_path_clicked = models.charfield(blank=true,max_length=255) #location icon stored icon_path_unclicked = models.charfield(blank=true,max_length=255) #location icon stored group_description = models.charfield(max_length=255) #description of group is_active = models.booleanfield(default=true) date_created = models.datetimefield(auto_now_add=true)
now previously, both icon_path_clicked
, icon_path_unclicked
had unique=true
, took out, yet when try , migrate, following error:
django.db.utils.integrityerror: not create unique index "everything_group_icon_path_clicked_key" detail: key (icon_path_clicked)=() duplicated.
why still treating if no longer have field unique?
full traceback
running migrations app: - migrating forwards 0013_auto__chg_field_group_icon_path_clicked__chg_field_group_icon_path_unc. > everything:0007_auto__add_field_group_icon_path_clicked__add_field_group_icon_path_unc fatal error - following sql query failed: alter table "everything_group" add column "icon_path_clicked" varchar(255) not null unique default ''; error was: not create unique index "everything_group_icon_path_clicked_key" detail: key (icon_path_clicked)=() duplicated. error in migration: everything:0007_auto__add_field_group_icon_path_clicked__add_field_group_icon_path_unc traceback (most recent call last): file "manage.py", line 10, in <module> execute_from_command_line(sys.argv) file "/library/python/2.7/site-packages/django-1.6-py2.7.egg/django/core/management/__init__.py", line 399, in execute_from_command_line utility.execute() file "/library/python/2.7/site-packages/django-1.6-py2.7.egg/django/core/management/__init__.py", line 392, in execute self.fetch_command(subcommand).run_from_argv(self.argv) file "/library/python/2.7/site-packages/django-1.6-py2.7.egg/django/core/management/base.py", line 242, in run_from_argv self.execute(*args, **options.__dict__) file "/library/python/2.7/site-packages/django-1.6-py2.7.egg/django/core/management/base.py", line 285, in execute output = self.handle(*args, **options) file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/management/commands/migrate.py", line 111, in handle ignore_ghosts = ignore_ghosts, file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/migration/__init__.py", line 220, in migrate_app success = migrator.migrate_many(target, workplan, database) file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/migration/migrators.py", line 230, in migrate_many result = migrator.__class__.migrate_many(migrator, target, migrations, database) file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/migration/migrators.py", line 305, in migrate_many result = self.migrate(migration, database) file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/migration/migrators.py", line 134, in migrate result = self.run(migration, database) file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/migration/migrators.py", line 115, in run return self.run_migration(migration, database) file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/migration/migrators.py", line 85, in run_migration migration_function() file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/migration/migrators.py", line 61, in <lambda> return (lambda: direction(orm)) file "/users/ryansaxe/documents/project/app/migrations/0007_auto__add_field_group_icon_path_clicked__add_field_group_icon_path_unc.py", line 14, in forwards keep_default=false) file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/db/generic.py", line 47, in _cache_clear return func(self, table, *args, **opts) file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/db/generic.py", line 418, in add_column self.execute(sql) file "/library/python/2.7/site-packages/south-0.8.3-py2.7.egg/south/db/generic.py", line 282, in execute cursor.execute(sql, params) file "/library/python/2.7/site-packages/django-1.6-py2.7.egg/django/db/backends/util.py", line 69, in execute return super(cursordebugwrapper, self).execute(sql, params) file "/library/python/2.7/site-packages/django-1.6-py2.7.egg/django/db/backends/util.py", line 53, in execute return self.cursor.execute(sql, params) file "/library/python/2.7/site-packages/django-1.6-py2.7.egg/django/db/utils.py", line 99, in __exit__ six.reraise(dj_exc_type, dj_exc_value, traceback) file "/library/python/2.7/site-packages/django-1.6-py2.7.egg/django/db/backends/util.py", line 53, in execute return self.cursor.execute(sql, params) django.db.utils.integrityerror: not create unique index "everything_group_icon_path_clicked_key" detail: key (icon_path_clicked)=() duplicated.
Comments
Post a Comment