Data filtering changes.
[emufront] / src / db / dbcreator.cpp
index 1baf264..e2691c6 100644 (file)
@@ -9,13 +9,13 @@
 // the Free Software Foundation, either version 3 of the License, or
 // (at your option) any later version.
 //
-// Foobar is distributed in the hope that it will be useful,
+// EmuFront is distributed in the hope that it will be useful,
 // but WITHOUT ANY WARRANTY; without even the implied warranty of
 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 // GNU General Public License for more details.
 //
 // You should have received a copy of the GNU General Public License
-// along with Foobar.  If not, see <http://www.gnu.org/licenses/>.
+// along with EmuFront.  If not, see <http://www.gnu.org/licenses/>.
 
 #include <QObject>
 #include <QSqlDatabase>
@@ -111,8 +111,7 @@ bool DbCreator::createDB()
         qDebug() << "Creating TABLE mediaimagecontainer";
 
         ret = query.exec("CREATE TABLE IF NOT EXISTS mediaimagecontainer "
-                        "(id INTEGER PRIMARY KEY, "
-                        "fileid INTEGER REFERENCES file(id), "
+                        "(fileid INTEGER REFERENCES file(id), "
                         "filepathid INTEGER REFERENCES filepath(id), "
                         "updatetime NUMERIC)");
 
@@ -122,10 +121,8 @@ bool DbCreator::createDB()
         qDebug() << "Creating TABLE mediaimagecontainer_mediaimage";
 
         ret = query.exec("CREATE TABLE IF NOT EXISTS mediaimagecontainer_mediaimage "
-                        "(mediaimagecontainerid INTEGER, "
-                        "fileid INTEGER, "
-                        "FOREIGN KEY (mediaimagecontainerid) REFERENCES mediaimagecontainer(id), "
-                        "FOREIGN KEY (fileid) REFERENCES file(id))");
+                        "(mediaimagecontainerid INTEGER REFERENCES file(id), "
+                        "mediaimageid INTEGER REFERENCES file(id))");
 
         if (!ret) throw QString("mediaimagecontainer_mediaimage");