liuyang1520 / django-command-extensions

Automatically exported from code.google.com/p/django-command-extensions
MIT License
0 stars 0 forks source link

sqldiff: __init__() got an unexpected keyword argument 'max_digits' #54

Closed GoogleCodeExporter closed 8 years ago

GoogleCodeExporter commented 8 years ago
What steps will reproduce the problem?
1. python manage.py sqldiff www

What is the expected output? What do you see instead?

I expect to see the SQL diff as described in the documentation, however I
only get:

philwo@vz102:~/www/example.com/myproj$ python manage.py sqldiff www
Traceback (most recent call last):
  File "manage.py", line 11, in <module>
    execute_manager(settings)
  File
"/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line
340, in execute_manager
    utility.execute()
  File
"/usr/lib/python2.5/site-packages/django/core/management/__init__.py", line
295, in execute
    self.fetch_command(subcommand).run_from_argv(self.argv)
  File "/usr/lib/python2.5/site-packages/django/core/management/base.py",
line 77, in run_from_argv
    self.execute(*args, **options.__dict__)
  File "/usr/lib/python2.5/site-packages/django/core/management/base.py",
line 96, in execute
    output = self.handle(*args, **options)
  File
"/usr/lib/python2.5/site-packages/django_extensions/management/commands/sqldiff.
py",
line 42, in handle
    super(Command, self).handle(*app_labels, **options)
  File "/usr/lib/python2.5/site-packages/django/core/management/base.py",
line 146, in handle
    app_output = self.handle_app(app, **options)
  File
"/usr/lib/python2.5/site-packages/django_extensions/management/commands/sqldiff.
py",
line 48, in handle_app
    self.handle_diff(app, **options)
  File "/usr/lib/python2.5/site-packages/django/db/transaction.py", line
263, in _commit_manually
    return func(*args, **kw)
  File
"/usr/lib/python2.5/site-packages/django_extensions/management/commands/sqldiff.
py",
line 136, in handle_diff
    db_field_type = getattr(models, db_field_reverse_type)(**kwargs).db_type()
TypeError: __init__() got an unexpected keyword argument 'max_digits'

What version of the product are you using? On what operating system?

Django 1.0, Linux, MySQL 5.0 DB

www/model.py is the same as the FlatPage one from Django:
http://code.djangoproject.com/browser/django/tags/releases/1.0/django/contrib/fl
atpages/models.py

Original issue reported on code.google.com by philipp....@gmail.com on 18 Sep 2008 at 7:49

GoogleCodeExporter commented 8 years ago
it works on sqlite and pgsql but when i try with mysql is also error's out for 
me.

Original comment by v.oostv...@gmail.com on 22 Sep 2008 at 9:49

GoogleCodeExporter commented 8 years ago
fixed the problem and made some other small enhancements for mysql.

But at the same time i discovered that MySQL has some horrible flaws for two way
differences of schematics. For example, MySQL does not make a distinction 
between a
boolean field and an integerfield. So it's impossible to know that if there is 
a real
difference between the model and the database.

After talking to people from django-evolution about this is became clear that
specially in the case of MySQL the problems are very big and numerious and 
certainly
not easy to solve.

So for the time being I've included a big fat warning when using sqldiff with 
MySQL.
Which basically states that we know that MySQL will not give correct results 
back and
that this well probably not be fixed in the near future. 

Original comment by v.oostv...@gmail.com on 22 Sep 2008 at 11:02