From 7e1280caae67f9797425e6dfc22a66782a264ed3 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Luis=20=C3=81ngel=20San=20Mart=C3=ADn?= Date: Thu, 27 Nov 2014 20:31:53 +0100 Subject: [PATCH] added missing primary keys --- YACReaderLibrary/db/data_base_management.cpp | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/YACReaderLibrary/db/data_base_management.cpp b/YACReaderLibrary/db/data_base_management.cpp index f5eb32df..a8014aec 100644 --- a/YACReaderLibrary/db/data_base_management.cpp +++ b/YACReaderLibrary/db/data_base_management.cpp @@ -238,7 +238,8 @@ bool DataBaseManagement::createV8Tables(QSqlDatabase &database) "label_id INTEGER, " //"order INTEGER, " //TODO order???? "FOREIGN KEY(label_id) REFERENCES label(id) ON DELETE CASCADE, " - "FOREIGN KEY(comic_id) REFERENCES comic(id) ON DELETE CASCADE)"); + "FOREIGN KEY(comic_id) REFERENCES comic(id) ON DELETE CASCADE, " + "PRIMARY KEY(label_id, comic_id))"); success = success && queryComicLabel.exec(); //READING LIST @@ -260,7 +261,8 @@ bool DataBaseManagement::createV8Tables(QSqlDatabase &database) "comic_id INTEGER, " "ordering INTEGER, " "FOREIGN KEY(reading_list_id) REFERENCES reading_list(id) ON DELETE CASCADE, " - "FOREIGN KEY(comic_id) REFERENCES comic(id) ON DELETE CASCADE)"); + "FOREIGN KEY(comic_id) REFERENCES comic(id) ON DELETE CASCADE, " + "PRIMARY KEY(reading_list_id, comic_id))"); success = success && queryComicReadingList.exec(); //DEFAULT READING LISTS