Skip to content

Instantly share code, notes, and snippets.

@wttw
Created June 20, 2017 15:00
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save wttw/68331db0571a5b8adbc25326042ed182 to your computer and use it in GitHub Desktop.
Save wttw/68331db0571a5b8adbc25326042ed182 to your computer and use it in GitHub Desktop.
-- Using text, for ease of working with:
CREATE TABLE file_hash (
hash_id integer PRIMARY KEY,
file_id integer REFERENCES file,
md5 text UNIQUE,
sha1 text UNIQUE,
photodna text UNIQUE
);
-- Using bytea, for space and speed benefits:
CREATE TABLE file_hash (
hash_id integer PRIMARY KEY,
file_id integer REFERENCES file,
md5 bytea UNIQUE,
sha1 bytea UNIQUE,
photodna bytea UNIQUE
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment