Compound/Composite primary/unique key with Django
Django does not support compound primary keys. You can create a single compound unique key with Meta.unique_together.
Django does not support compound primary keys. You can create a single compound unique key with Meta.unique_together.
Put the UNIQUE declaration within the column definition section; working example: CREATE TABLE a ( i INT, j INT, UNIQUE(i, j) ON CONFLICT REPLACE );