began database table definition and interface definition for the Universal

Message Store (UniStore)
This commit is contained in:
Eric J. Bowersox
2003-06-09 18:39:59 +00:00
parent e164b7d06f
commit a96eee5056
6 changed files with 267 additions and 2 deletions

View File

@@ -240,7 +240,80 @@ CREATE TABLE dictionary (
word VARCHAR(128) NOT NULL PRIMARY KEY # the word
);
#### following this line are Venice-specific tables ####
# UniStore: Message headers
CREATE TABLE us_head (
msgid BIGINT NOT NULL PRIMARY KEY AUTO_INCREMENT, # the message ID
parent BIGINT NOT NULL DEFAULT 0, # parent message (optional)
seq INT NOT NULL DEFAULT 0, # message sequence under parent (optional)
creator INT NOT NULL, # UID of person who created the message
posted DATETIME NOT NULL, # date/time message was posted
aclid INT NULL, # optional ACL ID for message
INDEX by_date (posted),
INDEX by_child (parent, seq)
);
# UniStore: Message properties
CREATE TABLE us_prop (
msgid BIGINT NOT NULL, # message ID
nsid INT NOT NULL, # property namespace ID
prop_name VARCHAR(255) BINARY NOT NULL, # property name
prop_value VARCHAR(255), # property value
PRIMARY KEY (msgid, nsid, prop_name)
);
# UniStore: Text message parts
CREATE TABLE us_text (
msgid BIGINT NOT NULL, # message ID
part INT NOT NULL, # index of text part
ident_nsid INT NOT NULL, # identity namespace ID
ident_name VARCHAR(255) BINARY NOT NULL, # identity name
mimetype VARCHAR(128), # MIME type of text
charcount INT, # number of characters in text
linecount INT, # number of lines in text
reads INT NOT NULL DEFAULT 0, # number of times this part has been read
last_read DATETIME, # timestamp of when it was last read
data MEDIUMTEXT, # the text (16 Mb available)
PRIMARY KEY (msgid, part),
INDEX by_name (msgid, ident_nsid, ident_name)
);
# UniStore: Text message part properties
CREATE TABLE us_text_prop (
msgid BIGINT NOT NULL, # message ID
part INT NOT NULL, # index of text part
nsid INT NOT NULL, # property namespace ID
prop_name VARCHAR(255) BINARY NOT NULL, # property name
prop_value VARCHAR(255), # property value
PRIMARY KEY (msgid, part, nsid, prop_name)
);
# UniStore: Binary message parts
CREATE TABLE us_binary (
msgid BIGINT NOT NULL, # message ID
part INT NOT NULL, # index of binary part
ident_nsid INT NOT NULL, # identity namespace ID
ident_name VARCHAR(255) BINARY NOT NULL, # identity name
mimetype VARCHAR(128), # MIME type of data
datalen INT, # data length in bytes
filename VARCHAR(255), # original source filename
reads INT NOT NULL DEFAULT 0, # number of times this part has been read
last_read DATETIME, # timestamp of when it was last read
data MEDIUMBLOB, # the actual data (16 Mb of space available)
PRIMARY KEY (msgid, part),
INDEX by_name (msgid, ident_nsid, ident_name)
);
# UniStore: Binary message part properties
CREATE TABLE us_binary_prop (
msgid BIGINT NOT NULL, # message ID
part INT NOT NULL, # index of binary part
nsid INT NOT NULL, # property namespace ID
prop_name VARCHAR(255) BINARY NOT NULL, # property name
prop_value VARCHAR(255), # property value
PRIMARY KEY (msgid, part, nsid, prop_name)
);
############################ following this line are Venice-specific tables ############################
# The table which defines menus.
CREATE TABLE menus (