generated from just-the-docs/just-the-docs-template
-
Notifications
You must be signed in to change notification settings - Fork 0
/
init.sql
33 lines (32 loc) · 907 Bytes
/
init.sql
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
-- Main table holding all the files in the storage/vault
CREATE TABLE files (
id SERIAL PRIMARY KEY,
hash VARCHAR(64) NOT NULL,
path TEXT UNIQUE NOT NULL,
filename TEXT,
filesize BIGINT,
mime TEXT,
date_created TIMESTAMP,
gps_lat REAL,
gps_lon REAL,
gps_alt REAL,
metadata JSONB DEFAULT NULL,
transcript TEXT,
scan_version INTEGER,
scanned_at TIMESTAMP,
analyzed_at TIMESTAMP,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
updated_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP,
removed_at TIMESTAMP
);
-- Table holding all the issues found in the files
CREATE TABLE file_issues (
id SERIAL PRIMARY KEY,
hash VARCHAR(64) NOT NULL,
path TEXT NOT NULL,
filename TEXT,
filesize BIGINT,
tool VARCHAR(64) NOT NULL,
issue TEXT NOT NULL,
created_at TIMESTAMP NOT NULL DEFAULT CURRENT_TIMESTAMP
);