Skip to content

Instantly share code, notes, and snippets.

@tomredsky
Created February 27, 2019 17:07
Show Gist options
  • Save tomredsky/282540e6845024e83a58ac6c125c3cf3 to your computer and use it in GitHub Desktop.
Save tomredsky/282540e6845024e83a58ac6c125c3cf3 to your computer and use it in GitHub Desktop.
media_files table
/* Not creating a fk between spl_number and ct.num
as we may use pg_logical to replicate this table
to the PG DB on www. If we don't it will be trivial
to add one later.
Also not adding a unique key between md5 as there are
about 2,100 duplicates at the moment.
*/
create table media_files(
spl_number varchar(9) not null,
pathpart varchar(64) not null,
md5 varchar(32) not null,
dimensions varchar(11) not null,
mtime int not null,
unique(spl_number, pathpart)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment