email/pg/init-original.sql
Bill Thiede 1e70c13cf9 Harvest email addresses from messages.
Go tool for reading original messages from DB and filling out contact table.
SQL scripts for building address book table from most commonly referenced
    names per unique email address.
2014-03-27 21:38:00 -07:00

25 lines
435 B
SQL

DROP TABLE files;
DROP TABLE original;
DROP TABLE person;
CREATE TABLE files (
hash CHAR(40),
path TEXT
);
CREATE TABLE person (
uid SERIAL UNIQUE,
username TEXT,
name TEXT
);
INSERT INTO person (username, name) VALUES ('wathiede', 'Bill Thiede');
CREATE TABLE original (
uid INTEGER REFERENCES person (uid),
hash CHAR(40) PRIMARY KEY,
header_size INTEGER,
total_size INTEGER,
blob BYTEA
);