Re: more than one field as a primary key

2008-01-15 Thread J. Cliff Dyer
Have you re-synced your database? Nader wrote: > I have define the following model: > > class Ingestqueue(models.Model): > ingestQueueId = models.IntegerField(primary_key=True) > datasetID = models.IntegerField() > filename = models.CharField(maxlength=100) > timeOfRemoteMOD = mode

Re: more than one field as a primary key

2008-01-15 Thread David Grant
I think there is a ticket to add support for compound primary keys... On Jan 15, 2008 3:52 AM, Nader <[EMAIL PROTECTED]> wrote: > > Hallo, > > I have a "MySQL" table which has more than one field ad a primary key: > > CREATE TABLE `ingestQueue` ( > `datasetID` int(11) NOT NULL, > `filename` var

Re: more than one field as a primary key

2008-01-15 Thread Nader
I have define the following model: class Ingestqueue(models.Model): ingestQueueId = models.IntegerField(primary_key=True) datasetID = models.IntegerField() filename = models.CharField(maxlength=100) timeOfRemoteMOD = models.DateTimeField() ingestModuleID = models.IntegerField(

Re: more than one field as a primary key

2008-01-15 Thread Remco Gerlich
As far as I know, it's currently not possible in Django. The solution would be to add a (auto-increment) ingestQueueId field as a primary key, and in the meantime 1) declare your current primary key fields to be unique, 2) create an index for those fields in MySQL. To make multiple fields unique

more than one field as a primary key

2008-01-15 Thread Nader
Hallo, I have a "MySQL" table which has more than one field ad a primary key: CREATE TABLE `ingestQueue` ( `datasetID` int(11) NOT NULL, `filename` varchar(80) NOT NULL default '', `timeOfRemoteMOD` datetime NOT NULL default '-00-00 00:00:00', `ingestModuleID` int(11) NOT NULL, `da