Fixed #1286 -- Improved 'inspectdb' so that it introspects primary_key=True and unique=True for MySQL. Thanks, gandalf@owca.info

git-svn-id: http://code.djangoproject.com/svn/django/trunk@2346 bcc190cf-cafb-0310-a4f2-bffc1f526a37
This commit is contained in:
Adrian Holovaty 2006-02-18 21:26:28 +00:00
parent b46128225d
commit ac97cf54af
8 changed files with 51 additions and 13 deletions

View file

@ -112,12 +112,13 @@ output:
This feature is meant as a shortcut, not as definitive model generation. After
you run it, you'll want to look over the generated models yourself to make
customizations. In particular, you'll need to do this:
customizations. In particular, you'll need to rearrange models' order, so that
models that refer to other models are ordered properly.
* Rearrange models' order, so that models that refer to other models are
ordered properly.
* Add ``primary_key=True`` to one field in each model. The ``inspectdb``
doesn't yet introspect primary keys.
If you're using Django 0.90 or 0.91, you'll need to add ``primary_key=True`` to
one field in each model. In the Django development version, primary keys are
automatically introspected for MySQL, and Django puts in the
``primary_key=True`` where needed.
``inspectdb`` works with PostgreSQL, MySQL and SQLite. Foreign-key detection
only works in PostgreSQL.