Created
September 13, 2018 14:29
-
-
Save lthms/bef9dcdb4e079e0ff8cfe2201f5a0cb3 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
CREATE TABLE entities ( | |
id SERIAL PRIMARY KEY, | |
time INT4RANGE, | |
class SMALLINT NOT NULL | |
); | |
CREATE TABLE documents ( | |
id SERIAL PRIMARY KEY, | |
language INT2 NOT NULL, | |
raw TEXT NOT NULL, | |
rendered TEXT NOT NULL | |
); | |
CREATE TABLE characters ( | |
id SERIAL PRIMARY KEY, | |
entity_id INTEGER NOT NULL REFERENCES entities, | |
name VARCHAR(80) NOT NULL, | |
history INTEGER NOT NULL REFERENCES documents | |
); | |
CREATE TABLE relationships ( | |
id SERIAL PRIMARY KEY, | |
origin INTEGER NOT NULL REFERENCES characters, | |
destination INTEGER NOT NULL REFERENCES characters, | |
during INT4RANGE, | |
description INTEGER NOT NULL REFERENCES documents | |
); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment