docs/db.sql
author Tero Marttila <terom@fixme.fi>
Sun, 14 Jun 2009 17:19:41 +0300
changeset 112 e990b7a54d40
parent 41 3b1579a7bffb
permissions -rw-r--r--
only load the resources/pkg_resources stuff if needed - slight optimization for importing without referencing the stylesheet
CREATE TABLE 'nodes' (id INTEGER NOT NULL PRIMARY KEY, dirpath TEXT NOT NULL, filename TEXT NOT NULL);
CREATE TABLE tags (image INTEGER NOT NULL, type TEXT, tag TEXT NOT NULL);
CREATE VIEW images AS SELECT id, dirpath, filename FROM nodes WHERE filename != '';
CREATE UNIQUE INDEX tags_unique_image_type ON tags (image, type);
CREATE UNIQUE INDEX tags_unique_image_type_tag ON tags (image, type, tag);