Hmm. It seems to be database-specific. PostgreSQL and Oracle require
that foreign key references be unique, while MySQL and SQLite do not
(although for SQLite that's mainly due to it not actually implementing
foreign key constraints). The MySQL documentation has this to say:
>> Additionally,
On Tue, 2009-08-11 at 12:00 -0700, physicsnick wrote:
> Actually they don't need to be unique (and I don't want them to be
> unique). MySQL does not require that foreign keys be unique; only that
> they be indexed.
>
> I am actually using this for a temporal database. There are many
> instances
Actually they don't need to be unique (and I don't want them to be
unique). MySQL does not require that foreign keys be unique; only that
they be indexed.
I am actually using this for a temporal database. There are many
instances of an Author with the same code (an instance for each time
it was
On Mon, Aug 10, 2009 at 3:52 PM, physicsnick wrote:
>
> Hello,
>
> I'm trying to use ForeignKey on a specific indexed column using the
> to_field attribute. Unfortunately syncdb seems to be outputting the
> ADD CONSTRAINT statement before the CREATE INDEX on the to_field,
Hello,
I'm trying to use ForeignKey on a specific indexed column using the
to_field attribute. Unfortunately syncdb seems to be outputting the
ADD CONSTRAINT statement before the CREATE INDEX on the to_field, so
mysql refuses to add the constraint and syncdb quits with an
exception.
Here's a
5 matches
Mail list logo