Skip to content

Instantly share code, notes, and snippets.

@swwelch
Created August 8, 2016 21:09
Show Gist options
  • Star 3 You must be signed in to star a gist
  • Fork 11 You must be signed in to fork a gist
  • Save swwelch/f1144229848b407e0a5d13fcb7fbbd6f to your computer and use it in GitHub Desktop.
Save swwelch/f1144229848b407e0a5d13fcb7fbbd6f to your computer and use it in GitHub Desktop.
CREATE TABLE nodes (
id INTEGER PRIMARY KEY NOT NULL,
lat REAL,
lon REAL,
user TEXT,
uid INTEGER,
version INTEGER,
changeset INTEGER,
timestamp TEXT
);
CREATE TABLE nodes_tags (
id INTEGER,
key TEXT,
value TEXT,
type TEXT,
FOREIGN KEY (id) REFERENCES nodes(id)
);
CREATE TABLE ways (
id INTEGER PRIMARY KEY NOT NULL,
user TEXT,
uid INTEGER,
version TEXT,
changeset INTEGER,
timestamp TEXT
);
CREATE TABLE ways_tags (
id INTEGER NOT NULL,
key TEXT NOT NULL,
value TEXT NOT NULL,
type TEXT,
FOREIGN KEY (id) REFERENCES ways(id)
);
CREATE TABLE ways_nodes (
id INTEGER NOT NULL,
node_id INTEGER NOT NULL,
position INTEGER NOT NULL,
FOREIGN KEY (id) REFERENCES ways(id),
FOREIGN KEY (node_id) REFERENCES nodes(id)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment