Skip to content

Instantly share code, notes, and snippets.

@brianv0
Last active July 27, 2018 17:56
Show Gist options
  • Save brianv0/021f95597028e868d56450d5d924a968 to your computer and use it in GitHub Desktop.
Save brianv0/021f95597028e868d56450d5d924a968 to your computer and use it in GitHub Desktop.
ReplicatedDatastore
create table ReplicatedDatasetSite (
site_id integer primary key,
name varchar(20)
);
create table ReplicatedDataset (
replicated_dataset_id integer primary key,
created timestamp, -- date of initial dataset ingestion
modified timestamp -- The last time this dataset or a replica was modified
);
create table ReplicatedDatasetLocation (
location_id integer primary key,
replicated_dataset_id integer, -- alternatively omit (FK to ReplicatedLocation)
dataset_id integer, -- alternatively omit (FK to Dataset)
site_id integer, -- FK to DatasetSite
is_master boolean, -- Is this the master replica? (or a master_site_id could be in ReplicatedDataset)
uri varchar(1024), -- file path (excessively large to support long names)
created timestamp, -- When this record/row was created
modified timestamp, -- Last time this record/row was modified
scanned timestamp, -- If you scan files to verify integrity, the last time this location was scanned
scanned_status varchar(20),
file_size integer, -- size in bytes
cksum_crc32 integer, -- output from cksum (nullable)
-- cksum_user varchar2(256), -- Alternative checksums in the form of '[ALG]:VALUE' (nullable) or https://github.com/multiformats/multihash
ctime timestamp, -- ctime as reported by file system
mtime timestamp -- mtime as reported by file system
);
/*
create table ReplicationPolicy
create table ReplicationTransaction
create table Replication....
*/
@brianv0
Copy link
Author

brianv0 commented Jul 27, 2018

cksum_user might look like md5:ecc0186f1a7727565edee99d7cb2144a for example.
It's meant to have the algorithm and the checksum in it

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment