Open GoogleCodeExporter opened 9 years ago
As your saying AUTO_INCREMENT I'm assuming your using mysql.
I hope somebody can write up a patch for this.
As I write in the source of sqldiff there are a lot of known issues with MySQL:
- MySQL has by far the most problems with introspection. Please be carefull when
using MySQL with sqldiff.
- Booleans are reported back as Integers, so there's know way to know if there was
a real change.
- Varchar sizes are reported back without unicode support so there size may change
in comparison to the real length of the varchar.
- Some of the 'fixes' to counter these problems might create false positives or
false negatives.
I've added 'bigint' to the types in sqldiff which need an AUTO_INCREMENT if
there
also a primary key. Hopefully this works, however since Django's MySQL database
backend doesn't support bigint and I don't have MySQL to test this I'm not sure
about
that.
Please test this with the latest version from github.
http://github.com/django-extensions/django-extensions/commit/309f9b61f09a6273ff7
8e93b98a0d9008a9f77a2
Original comment by v.oostv...@gmail.com
on 16 Jul 2009 at 10:23
I put this comment on the actual change - should be here:
Why check db_type at all? That seems unnecessary and leaves open the
possibility of tinyint failing or
something.
Original comment by arocki...@gmail.com
on 20 Jul 2009 at 10:16
It's been awhile, and my head is filled with other code at the moment.
But db_type also checks changes the other way around.
Where you did a ALTER TABLE foo ALTER COLUMN foo_field TYPE bigint;
Now sqldiff should detect that 'foo_field' is an integer in your django models
and a
bigint in the database.
Is this what you mean ?
(btw did the above patch work ?)
Original comment by v.oostv...@gmail.com
on 23 Jul 2009 at 1:24
I haven't bothered to test it but it would probably work. As someone else
commented though it looks like a hack
solution. It's pretty useless now anyway since on trunk sqldiff refuses to
output SQL commands for MySQL now.
It just tells me the differences, which is kind of useless since on development
I already know the differences and
on server I can just diff the table definitions from a dump.
Original comment by physicsn...@gmail.com
on 17 Aug 2009 at 8:54
Original issue reported on code.google.com by
physicsn...@gmail.com
on 7 Jul 2009 at 8:26