Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 12 additions & 0 deletions api/api_sources/schema-files/watercraftRiskAssessment.schema.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -270,6 +270,18 @@ schemas:
required: false
meta: {}
## -- end: inspectionTime
## -- version: officerInspection
- name: "officerInspection"
id: "20260203"
info: "Adding new column officerInspection (officer_inspection_ind)"
columns:
officerInspection:
name: officer_inspection_ind
comment: "Indicator to show that inspection was directed by an officer after a blow by was returned to station"
definition: BOOLEAN NOT NULL DEFAULT FALSE
required: false
meta: {}
## -- end: officerInspection
## -- version: k9InspectionResults
- name: "k9InspectionResults"
id: "20230330"
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
-- ## Reverting table: watercraft_risk_assessment
-- ## Version: officerInspection
-- ## Info: Adding new column officerInspection
-- ## Removing New Columns ## --
ALTER TABLE watercraft_risk_assessment DROP COLUMN IF EXISTS officer_inspection_ind;

-- ## Updating watercraft_risk_assessment ## --
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
-- ## Changing table: watercraft_risk_assessment
-- ## Version: officerInspection
-- ## Info: Adding new column officerInspection
-- ## Adding New Columns ## --

-- ## Adding Column officer_inspection_ind on table watercraft_risk_assessment
ALTER TABLE watercraft_risk_assessment ADD COLUMN officer_inspection_ind BOOLEAN NULL DEFAULT FALSE;
COMMENT ON COLUMN watercraft_risk_assessment.officer_inspection_ind IS 'Indicator to show that inspection was directed by an officer after a blow by was returned to station';
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice, love comments on these 👍

-- ## --


-- ## Updating watercraft_risk_assessment ## --
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
import { MigrationInterface, QueryRunner } from 'typeorm';
import { AppDBMigrator } from '../applicationSchemaInterface';
import { WatercraftRiskAssessmentSchema } from '../database-schema';

export class OfficerInspectionInd1770145227143 extends AppDBMigrator implements MigrationInterface {
watercraftRiskAssessment: WatercraftRiskAssessmentSchema;

setup() {
this.watercraftRiskAssessment = new WatercraftRiskAssessmentSchema();
this.addSchemaVersion(this.watercraftRiskAssessment, 'officerInspection');
}

public async up(queryRunner: QueryRunner): Promise<any> {
// Start Log
this.log('[START]', 'UP');
// Running all up migration files
await this.runQuerySqlFiles(this.upMigrations(), queryRunner);
this.log('[END]', 'UP');
}

public async down(queryRunner: QueryRunner): Promise<any> {
this.log('[STAR]', 'DOWN');
await this.runQuerySqlFiles(this.downMigrations(), queryRunner);
this.log('[END]', 'DOWN');
}

}
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,7 @@ export class WatercraftRiskAssessmentController extends RecordController<Watercr
shiftStartComment: (basePriority - 120),
shiftEndComment: (basePriority - 140),
timestamp: (basePriority + - 145),
officerInspection: (basePriority - 147),
passportHolder: (basePriority - 150),
isNewPassportIssued: (basePriority - 155),
passportNumber: (basePriority - 160),
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,7 @@ export interface WatercraftRiskAssessmentSpec {
timestamp: string;
passportHolder: boolean;
inspectionTime: string;
officerInspection: boolean;
isNewPassportIssued: boolean;
k9Inspection: boolean;
k9InspectionResults: string;
Expand Down Expand Up @@ -104,6 +105,7 @@ export interface WatercraftRiskAssessmentUpdateSpec {
timestamp?: string;
passportHolder?: boolean;
inspectionTime: string;
officerInspection: boolean;
k9Inspection?: boolean;
k9InspectionResults?: string;
marineSpeciesFound?: boolean;
Expand Down Expand Up @@ -189,6 +191,13 @@ export class WatercraftRiskAssessment extends Record implements WatercraftRiskAs
@ModelProperty({ type: PropertyType.string })
inspectionTime: string;

/**
* @description Getter/Setter property for column {officer_inspection_ind}
*/
@Column({ name: WatercraftRiskAssessmentSchema.columns.officerInspection })
@ModelProperty({ type: PropertyType.boolean })
officerInspection: boolean;

/**
* @description Getter/Setter property for column {is_new_passport_issued}
*/
Expand Down
Loading