Skip to content

Instantly share code, notes, and snippets.

@hinrik
Created January 29, 2010 20:25
Show Gist options
  • Save hinrik/290089 to your computer and use it in GitHub Desktop.
Save hinrik/290089 to your computer and use it in GitHub Desktop.
CREATE TABLE info (
attribute TEXT NOT NULL UNIQUE PRIMARY KEY,
text TEXT NOT NULL
);
CREATE TABLE expr (
id INTEGER PRIMARY KEY AUTOINCREMENT,
text TEXT UNIQUE,
);
CREATE TABLE link (
id INTEGER PRIMARY KEY AUTOINCREMENT,
expr_id_prev INTEGER NOT NULL REFERENCES expr (id),
expr_id_next INTEGER NOT NULL REFERENCES expr (id),
weight INTEGER NOT NULL
);
CREATE INDEX link_prev ON link (expr_id_prev);
CREATE INDEX link_next ON link (expr_id_next);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment