From 8a1ba7b0923da045650a8fa70fd18059f9e0cb1c Mon Sep 17 00:00:00 2001 From: DJensen94 <79864006+DJensen94@users.noreply.github.com> Date: Tue, 19 Mar 2024 18:48:41 -0400 Subject: [PATCH] update column parameters update some of the default parameters of the columns in the new database --- backend/src/models/mini_data_lake/cert_scans.ts | 2 +- backend/src/models/mini_data_lake/contacts.ts | 2 +- backend/src/models/mini_data_lake/host_scans.ts | 2 +- backend/src/models/mini_data_lake/hosts.ts | 2 +- backend/src/models/mini_data_lake/kevs.ts | 2 +- backend/src/models/mini_data_lake/precert_scans.ts | 2 +- backend/src/models/mini_data_lake/reports.ts | 2 +- backend/src/models/mini_data_lake/requests.ts | 2 +- backend/src/models/mini_data_lake/snapshots.ts | 4 ++-- backend/src/models/mini_data_lake/tag.ts | 4 ++-- backend/src/models/mini_data_lake/tickets.ts | 2 +- backend/src/models/mini_data_lake/trustymail_scans.ts | 4 ++-- backend/src/models/mini_data_lake/vuln_scans.ts | 2 +- 13 files changed, 16 insertions(+), 16 deletions(-) diff --git a/backend/src/models/mini_data_lake/cert_scans.ts b/backend/src/models/mini_data_lake/cert_scans.ts index 0c08014a..47c78626 100644 --- a/backend/src/models/mini_data_lake/cert_scans.ts +++ b/backend/src/models/mini_data_lake/cert_scans.ts @@ -35,7 +35,7 @@ export class CertScan extends BaseEntity { }) pem: string | null; - @Column() + @Column({nullable: true}) sctExists: boolean; @Column({ nullable: true, type: 'timestamp' }) diff --git a/backend/src/models/mini_data_lake/contacts.ts b/backend/src/models/mini_data_lake/contacts.ts index 775320c6..c778eec9 100644 --- a/backend/src/models/mini_data_lake/contacts.ts +++ b/backend/src/models/mini_data_lake/contacts.ts @@ -41,7 +41,7 @@ export class Contact extends BaseEntity { }) type: string | null; - @Column() + @Column({nullable: true}) retired: boolean; @ManyToMany((type) => Organization, (org) => org.contacts, { diff --git a/backend/src/models/mini_data_lake/host_scans.ts b/backend/src/models/mini_data_lake/host_scans.ts index e05d4825..c059463a 100644 --- a/backend/src/models/mini_data_lake/host_scans.ts +++ b/backend/src/models/mini_data_lake/host_scans.ts @@ -51,7 +51,7 @@ export class HostScan extends BaseEntity { }) hostname: string | null; - @Column() + @Column({nullable: true}) latest: boolean; @Column({ diff --git a/backend/src/models/mini_data_lake/hosts.ts b/backend/src/models/mini_data_lake/hosts.ts index 05df342a..65c00e6f 100644 --- a/backend/src/models/mini_data_lake/hosts.ts +++ b/backend/src/models/mini_data_lake/hosts.ts @@ -81,7 +81,7 @@ export class Host extends BaseEntity { }) currStage: string | null; - @Column() + @Column({nullable: true}) hostLive: boolean; @Column({ diff --git a/backend/src/models/mini_data_lake/kevs.ts b/backend/src/models/mini_data_lake/kevs.ts index c8a90e81..18c40962 100644 --- a/backend/src/models/mini_data_lake/kevs.ts +++ b/backend/src/models/mini_data_lake/kevs.ts @@ -23,7 +23,7 @@ export class Kev extends BaseEntity { }) cve: string | null; - @Column() + @Column({nullable: true}) knownRansomware: boolean; @OneToMany((type) => Ticket, (ticket) => ticket.kev, { diff --git a/backend/src/models/mini_data_lake/precert_scans.ts b/backend/src/models/mini_data_lake/precert_scans.ts index 2a61f3fb..bbcc7172 100644 --- a/backend/src/models/mini_data_lake/precert_scans.ts +++ b/backend/src/models/mini_data_lake/precert_scans.ts @@ -35,7 +35,7 @@ export class PrecertScan extends BaseEntity { }) pem: string | null; - @Column() + @Column({nullable: true}) sctExists: boolean; @Column({ nullable: true, type: 'timestamp' }) diff --git a/backend/src/models/mini_data_lake/reports.ts b/backend/src/models/mini_data_lake/reports.ts index 82d824be..bee312a2 100644 --- a/backend/src/models/mini_data_lake/reports.ts +++ b/backend/src/models/mini_data_lake/reports.ts @@ -20,7 +20,7 @@ export class Report extends BaseEntity { @Column({ nullable: true, type: 'timestamp' }) createdTimestamp: Date | null; - @Column('simple-array') + @Column("varchar", { array: true, default: []}) reportTypes: string[]; @ManyToOne((type) => Snapshot, (snapshot) => snapshot.reports, { diff --git a/backend/src/models/mini_data_lake/requests.ts b/backend/src/models/mini_data_lake/requests.ts index 6a60f618..3daf2d51 100644 --- a/backend/src/models/mini_data_lake/requests.ts +++ b/backend/src/models/mini_data_lake/requests.ts @@ -59,7 +59,7 @@ export class Request extends BaseEntity { @Column({ nullable: true }) retired: boolean; - @Column('simple-array') + @Column("varchar", { array: true, default: []}) reportTypes: string[]; @Column({ diff --git a/backend/src/models/mini_data_lake/snapshots.ts b/backend/src/models/mini_data_lake/snapshots.ts index 3487e13d..f2ec32f6 100644 --- a/backend/src/models/mini_data_lake/snapshots.ts +++ b/backend/src/models/mini_data_lake/snapshots.ts @@ -50,10 +50,10 @@ export class Snapshot extends BaseEntity { @Column({ nullable: true, type: 'timestamp' }) updatedTimestamp: Date | null; - @Column() + @Column({nullable: true}) latest: boolean; - @Column('simple-array') + @Column("varchar", { array: true, default: []}) networks: string[]; @ManyToOne((type) => Organization, (org) => org.snapshots, { diff --git a/backend/src/models/mini_data_lake/tag.ts b/backend/src/models/mini_data_lake/tag.ts index 71617c38..917e19fd 100644 --- a/backend/src/models/mini_data_lake/tag.ts +++ b/backend/src/models/mini_data_lake/tag.ts @@ -3,7 +3,7 @@ import { Entity, Column, - PrimaryColumn, + PrimaryGeneratedColumn, BaseEntity, ManyToMany, JoinTable @@ -12,7 +12,7 @@ import { import { Organization } from './organizations'; @Entity() export class Tag extends BaseEntity { - @PrimaryColumn() + @PrimaryGeneratedColumn() id: string; @Column({ diff --git a/backend/src/models/mini_data_lake/tickets.ts b/backend/src/models/mini_data_lake/tickets.ts index b3924d37..e031b634 100644 --- a/backend/src/models/mini_data_lake/tickets.ts +++ b/backend/src/models/mini_data_lake/tickets.ts @@ -77,7 +77,7 @@ export class Ticket extends BaseEntity { }) vprScore: number | null; - @Column() + @Column({nullable: true}) falsePositive: boolean; @Column({ diff --git a/backend/src/models/mini_data_lake/trustymail_scans.ts b/backend/src/models/mini_data_lake/trustymail_scans.ts index 8568fa99..230f1a88 100644 --- a/backend/src/models/mini_data_lake/trustymail_scans.ts +++ b/backend/src/models/mini_data_lake/trustymail_scans.ts @@ -68,7 +68,7 @@ export class TrustymailScan extends BaseEntity { }) dmarcResultsBaseDomain: string | null; - @Column() + @Column({nullable: true}) domainSupportsSmtp: boolean; @Column({ @@ -77,7 +77,7 @@ export class TrustymailScan extends BaseEntity { }) domainSupportsSmtpResults: string | null; - @Column() + @Column({nullable: true}) domainSupportsStarttls: boolean; @Column({ diff --git a/backend/src/models/mini_data_lake/vuln_scans.ts b/backend/src/models/mini_data_lake/vuln_scans.ts index 48f7e979..b505f064 100644 --- a/backend/src/models/mini_data_lake/vuln_scans.ts +++ b/backend/src/models/mini_data_lake/vuln_scans.ts @@ -111,7 +111,7 @@ export class VulnScan extends BaseEntity { }) ip: Ip; - @Column() + @Column({nullable: true}) latest: boolean; @Column({