db/db.sql
author terom
Tue, 18 Mar 2008 00:04:02 +0000
changeset 32 cc2d9db311c0
permissions -rw-r--r--
database dir and schema
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);