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.
25 lines
435 B
SQL
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
|
|
);
|