summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authoremkael <emkael@tlen.pl>2016-03-12 12:07:11 +0100
committeremkael <emkael@tlen.pl>2016-03-12 12:07:11 +0100
commit7bb05e12bf767ff0e9894ac984bc36b244bcfcb9 (patch)
tree1bc61f8615d5d7f3830daaf913876a09f5de11a5
parent48619109291ed90bd0e11f4be27384ca7a95ddf4 (diff)
* composite primary key for user preference table
-rw-r--r--app/python/rcal/model.py6
1 files changed, 4 insertions, 2 deletions
diff --git a/app/python/rcal/model.py b/app/python/rcal/model.py
index 705fba2..3ecfceb 100644
--- a/app/python/rcal/model.py
+++ b/app/python/rcal/model.py
@@ -124,9 +124,11 @@ class Category(BASE):
user_selections = Table(
'user_selections', BASE.metadata,
Column('_user', Integer,
- ForeignKey('users.id', onupdate='CASCADE', ondelete='CASCADE')),
+ ForeignKey('users.id', onupdate='CASCADE', ondelete='CASCADE'),
+ primary_key=True),
Column('_calendar', String(255),
- ForeignKey('calendars.uid', onupdate='CASCADE', ondelete='CASCADE'))
+ ForeignKey('calendars.uid', onupdate='CASCADE', ondelete='CASCADE'),
+ primary_key=True)
)