3d434eedb8
Job Status Get and DB tidy up * initalquery * tests * shorttests * testing queries * job * solvedthequery * updatingdb * fixingtests * repotests * shorttests * docker * testspassed
34 lines
926 B
SQL
34 lines
926 B
SQL
CREATE TABLE documents (
|
|
id uuid primary key DEFAULT uuid_generate_v7(),
|
|
jobId uuid not null,
|
|
hash text not null,
|
|
foreign key (jobId) references jobs(id),
|
|
unique(jobId, hash)
|
|
);
|
|
|
|
CREATE TABLE documentEntries (
|
|
id uuid primary key DEFAULT uuid_generate_v7(),
|
|
documentId uuid not null,
|
|
bucket text not null,
|
|
key text not null,
|
|
foreign key (documentId) references documents(id)
|
|
);
|
|
|
|
CREATE TABLE documentCleans (
|
|
id uuid primary key DEFAULT uuid_generate_v7(),
|
|
documentId uuid not null,
|
|
version int not null,
|
|
bucket text not null,
|
|
key text not null,
|
|
foreign key (documentId) references documents(id)
|
|
);
|
|
|
|
CREATE TABLE documentTextExtractions (
|
|
id uuid primary key DEFAULT uuid_generate_v7(),
|
|
cleanEntryId uuid not null,
|
|
version int not null,
|
|
bucket text not null,
|
|
key text not null,
|
|
foreign key (cleanEntryId) references documentCleans(id)
|
|
);
|