Is there any way I can create a primary key composite of 2 fields in django?
Here is an example table:
Note the primary key and index.
Additionally, for general knowledge, how do I override the ID as a primary key?
Thanks in advance.
Here is an example table:
sql Code:
|
CREATE TABLE taggedUsers ( user_id integer NOT NULL , tag_id integer NOT NULL , FOREIGN KEY ( user_id ) REFERENCES users ( id ) , FOREIGN KEY ( tag_id ) REFERENCES tags ( id ) , PRIMARY KEY ( user_id, tag_id ) , INDEX ( tag_id, user_id ) );
Note the primary key and index.
Additionally, for general knowledge, how do I override the ID as a primary key?
Thanks in advance.
