Files
query-orchestration/database/migrations/00000000000005_collectors.up.sql
T
Michael McGuinness 5b7160fe44 Merged in fature/jobs (pull request #34)
Job Collector

* createstructure

* mostupdatevalidation

* repocollectorupdate

* updateoutline

* updatevalidation

* scriptupdate

* cleanupdockerignore

* update

* collectorupdateapi
2025-01-23 14:56:20 +00:00

30 lines
939 B
SQL

CREATE TABLE collectors (
id uuid primary key DEFAULT gen_random_uuid(),
jobId uuid not null,
latestVersion int not null default 1,
activeVersion int not null default 1,
foreign key (jobId) references jobs(id),
unique (jobId)
);
CREATE TABLE collectorCodeVersions (
id uuid primary key DEFAULT gen_random_uuid(),
collectorId uuid not null,
minCleanVersion int not null,
minTextVersion int not null,
addedVersion int not null,
removedVersion int,
foreign key (collectorId) references collectors(id)
);
CREATE TABLE collectorQueries (
id uuid primary key DEFAULT gen_random_uuid(),
collectorId uuid not null,
name varchar(255) not null,
queryId uuid not null,
addedVersion int not null,
removedVersion int,
foreign key (queryId) references queries(id),
foreign key (collectorId) references collectors(id),
unique (collectorId, name, removedVersion)
);