Is there any way I can create a primary key composite of 2 fields in django?



Here is an example table:


sql Code:
















Original
- sql Code


  1.  
  2. CREATE TABLE taggedUsers
  3. ( user_id integer NOT NULL
  4. , tag_id  integer NOT NULL
  5. , FOREIGN KEY ( user_id ) REFERENCES users ( id )
  6. , FOREIGN KEY ( tag_id ) REFERENCES tags ( id )
  7. , PRIMARY KEY ( user_id, tag_id )
  8. , INDEX ( tag_id, user_id )
  9. );




Note the primary key and index.



Additionally, for general knowledge, how do I override the ID as a primary key?



Thanks in advance.