From d6d8f104d5c3c35034e84e1f886450c89fc836cb Mon Sep 17 00:00:00 2001 From: Lawrence Lau Date: Wed, 21 Feb 2024 10:51:46 -0800 Subject: [PATCH] updated DBeaver task and nullable columns --- .../src/typeorm/Entities/NotificationQueue.ts | 4 +- .../typeorm/Entities/ProjectAgencyResponse.ts | 2 +- .../src/typeorm/Entities/ProjectProperty.ts | 4 +- .../1708123404599-NullableFields.ts | 127 -- .../1708536844664-NullableFields.ts | 159 +++ tools/dbeaver/tasks.json | 1170 ++++++++--------- 6 files changed, 749 insertions(+), 717 deletions(-) delete mode 100644 express-api/src/typeorm/Migrations/1708123404599-NullableFields.ts create mode 100644 express-api/src/typeorm/Migrations/1708536844664-NullableFields.ts diff --git a/express-api/src/typeorm/Entities/NotificationQueue.ts b/express-api/src/typeorm/Entities/NotificationQueue.ts index 9063df57b..f1ce04787 100644 --- a/express-api/src/typeorm/Entities/NotificationQueue.ts +++ b/express-api/src/typeorm/Entities/NotificationQueue.ts @@ -51,7 +51,7 @@ export class NotificationQueue extends BaseEntity { Tag: string; // Project Relation - @Column({ name: 'project_id', type: 'int' }) + @Column({ name: 'project_id', type: 'int', nullable: true }) ProjectId: number; @ManyToOne(() => Project, (Project) => Project.Id) @@ -59,7 +59,7 @@ export class NotificationQueue extends BaseEntity { Project: Project; // Agency Relation - @Column({ name: 'to_agency_id', type: 'int' }) + @Column({ name: 'to_agency_id', type: 'int', nullable: true }) ToAgencyId: number; @ManyToOne(() => Agency, (Agency) => Agency.Id) diff --git a/express-api/src/typeorm/Entities/ProjectAgencyResponse.ts b/express-api/src/typeorm/Entities/ProjectAgencyResponse.ts index 771a09cf3..a526e7351 100644 --- a/express-api/src/typeorm/Entities/ProjectAgencyResponse.ts +++ b/express-api/src/typeorm/Entities/ProjectAgencyResponse.ts @@ -26,7 +26,7 @@ export class ProjectAgencyResponse extends BaseEntity { OfferAmount: number; // Notification Relation - @Column({ name: 'notification_id', type: 'int' }) + @Column({ name: 'notification_id', type: 'int', nullable: true }) NotificationId: number; @ManyToOne(() => NotificationQueue, (Notification) => Notification.Id, { nullable: true }) diff --git a/express-api/src/typeorm/Entities/ProjectProperty.ts b/express-api/src/typeorm/Entities/ProjectProperty.ts index a49bb8147..cf8c8beca 100644 --- a/express-api/src/typeorm/Entities/ProjectProperty.ts +++ b/express-api/src/typeorm/Entities/ProjectProperty.ts @@ -28,7 +28,7 @@ export class ProjectProperty extends BaseEntity { PropertyType: PropertyType; // Parcel Relation - @Column({ name: 'parcel_id', type: 'int' }) + @Column({ name: 'parcel_id', type: 'int', nullable: true }) ParcelId: number; @ManyToOne(() => Parcel, (Parcel) => Parcel.Id) @@ -36,7 +36,7 @@ export class ProjectProperty extends BaseEntity { Parcel: Parcel; // Building Relation - @Column({ name: 'building_id', type: 'int' }) + @Column({ name: 'building_id', type: 'int', nullable: true }) BuildingId: number; @ManyToOne(() => Building, (Building) => Building.Id) diff --git a/express-api/src/typeorm/Migrations/1708123404599-NullableFields.ts b/express-api/src/typeorm/Migrations/1708123404599-NullableFields.ts deleted file mode 100644 index 0cbbab77e..000000000 --- a/express-api/src/typeorm/Migrations/1708123404599-NullableFields.ts +++ /dev/null @@ -1,127 +0,0 @@ -import { MigrationInterface, QueryRunner } from 'typeorm'; - -export class NullableFields1708123404599 implements MigrationInterface { - name = 'NullableFields1708123404599'; - - public async up(queryRunner: QueryRunner): Promise { - await queryRunner.query( - `ALTER TABLE "notification_queue" DROP CONSTRAINT "FK_5d7fe381cc5ac14b88f911c81c7"`, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" DROP CONSTRAINT "FK_705c9558182adb03383285e8674"`, - ); - await queryRunner.query(`DROP INDEX "public"."IDX_359a7aedcd7b3d97fda4bfbc83"`); - await queryRunner.query( - `ALTER TABLE "notification_queue" ALTER COLUMN "ProjectId" DROP NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" ALTER COLUMN "ToAgencyId" DROP NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "project_agency_response" DROP CONSTRAINT "FK_14fa612dd1f3ac554faa62f7ff9"`, - ); - await queryRunner.query( - `ALTER TABLE "project_agency_response" ALTER COLUMN "NotificationId" DROP NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "project_property" DROP CONSTRAINT "FK_a580df432f0e0c521225fc3327b"`, - ); - await queryRunner.query( - `ALTER TABLE "project_property" DROP CONSTRAINT "FK_de366a792fc0aef4f8718e42d9c"`, - ); - await queryRunner.query(`DROP INDEX "public"."IDX_a8615c36638af5cbe405f58fca"`); - await queryRunner.query(`ALTER TABLE "project_property" ALTER COLUMN "ParcelId" DROP NOT NULL`); - await queryRunner.query( - `ALTER TABLE "project_property" ALTER COLUMN "BuildingId" DROP NOT NULL`, - ); - await queryRunner.query(`DROP INDEX "public"."IDX_c32ecc1c2fd813140954bdfcc0"`); - await queryRunner.query(`ALTER TABLE "project_report" ALTER COLUMN "From" DROP NOT NULL`); - await queryRunner.query( - `CREATE UNIQUE INDEX "IDX_b000857089edf6cae23b9bc9b8" ON "user" ("Username") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_359a7aedcd7b3d97fda4bfbc83" ON "notification_queue" ("ProjectId", "TemplateId", "ToAgencyId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_a8615c36638af5cbe405f58fca" ON "project_property" ("ProjectId", "PropertyTypeId", "ParcelId", "BuildingId") `, - ); - await queryRunner.query( - `CREATE INDEX "IDX_c32ecc1c2fd813140954bdfcc0" ON "project_report" ("Id", "To", "From", "IsFinal") `, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" ADD CONSTRAINT "FK_5d7fe381cc5ac14b88f911c81c7" FOREIGN KEY ("ProjectId") REFERENCES "project"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" ADD CONSTRAINT "FK_705c9558182adb03383285e8674" FOREIGN KEY ("ToAgencyId") REFERENCES "agency"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "project_agency_response" ADD CONSTRAINT "FK_14fa612dd1f3ac554faa62f7ff9" FOREIGN KEY ("NotificationId") REFERENCES "notification_queue"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "project_property" ADD CONSTRAINT "FK_a580df432f0e0c521225fc3327b" FOREIGN KEY ("ParcelId") REFERENCES "parcel"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "project_property" ADD CONSTRAINT "FK_de366a792fc0aef4f8718e42d9c" FOREIGN KEY ("BuildingId") REFERENCES "building"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - } - - public async down(queryRunner: QueryRunner): Promise { - await queryRunner.query( - `ALTER TABLE "project_property" DROP CONSTRAINT "FK_de366a792fc0aef4f8718e42d9c"`, - ); - await queryRunner.query( - `ALTER TABLE "project_property" DROP CONSTRAINT "FK_a580df432f0e0c521225fc3327b"`, - ); - await queryRunner.query( - `ALTER TABLE "project_agency_response" DROP CONSTRAINT "FK_14fa612dd1f3ac554faa62f7ff9"`, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" DROP CONSTRAINT "FK_705c9558182adb03383285e8674"`, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" DROP CONSTRAINT "FK_5d7fe381cc5ac14b88f911c81c7"`, - ); - await queryRunner.query(`DROP INDEX "public"."IDX_c32ecc1c2fd813140954bdfcc0"`); - await queryRunner.query(`DROP INDEX "public"."IDX_a8615c36638af5cbe405f58fca"`); - await queryRunner.query(`DROP INDEX "public"."IDX_359a7aedcd7b3d97fda4bfbc83"`); - await queryRunner.query(`DROP INDEX "public"."IDX_b000857089edf6cae23b9bc9b8"`); - await queryRunner.query(`ALTER TABLE "project_report" ALTER COLUMN "From" SET NOT NULL`); - await queryRunner.query( - `CREATE INDEX "IDX_c32ecc1c2fd813140954bdfcc0" ON "project_report" ("Id", "IsFinal", "From", "To") `, - ); - await queryRunner.query( - `ALTER TABLE "project_property" ALTER COLUMN "BuildingId" SET NOT NULL`, - ); - await queryRunner.query(`ALTER TABLE "project_property" ALTER COLUMN "ParcelId" SET NOT NULL`); - await queryRunner.query( - `CREATE INDEX "IDX_a8615c36638af5cbe405f58fca" ON "project_property" ("ProjectId", "PropertyTypeId", "ParcelId", "BuildingId") `, - ); - await queryRunner.query( - `ALTER TABLE "project_property" ADD CONSTRAINT "FK_de366a792fc0aef4f8718e42d9c" FOREIGN KEY ("BuildingId") REFERENCES "building"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "project_property" ADD CONSTRAINT "FK_a580df432f0e0c521225fc3327b" FOREIGN KEY ("ParcelId") REFERENCES "parcel"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "project_agency_response" ALTER COLUMN "NotificationId" SET NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "project_agency_response" ADD CONSTRAINT "FK_14fa612dd1f3ac554faa62f7ff9" FOREIGN KEY ("NotificationId") REFERENCES "notification_queue"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" ALTER COLUMN "ToAgencyId" SET NOT NULL`, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" ALTER COLUMN "ProjectId" SET NOT NULL`, - ); - await queryRunner.query( - `CREATE INDEX "IDX_359a7aedcd7b3d97fda4bfbc83" ON "notification_queue" ("ProjectId", "ToAgencyId", "TemplateId") `, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" ADD CONSTRAINT "FK_705c9558182adb03383285e8674" FOREIGN KEY ("ToAgencyId") REFERENCES "agency"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - await queryRunner.query( - `ALTER TABLE "notification_queue" ADD CONSTRAINT "FK_5d7fe381cc5ac14b88f911c81c7" FOREIGN KEY ("ProjectId") REFERENCES "project"("Id") ON DELETE NO ACTION ON UPDATE NO ACTION`, - ); - } -} diff --git a/express-api/src/typeorm/Migrations/1708536844664-NullableFields.ts b/express-api/src/typeorm/Migrations/1708536844664-NullableFields.ts new file mode 100644 index 000000000..03221d318 --- /dev/null +++ b/express-api/src/typeorm/Migrations/1708536844664-NullableFields.ts @@ -0,0 +1,159 @@ +import { MigrationInterface, QueryRunner } from 'typeorm'; + +export class NullableFields1708536844664 implements MigrationInterface { + name = 'NullableFields1708536844664'; + + public async up(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "project" DROP CONSTRAINT "FK_f033e95537c91a7787c7a07c857"`, + ); + await queryRunner.query(`DROP INDEX "public"."IDX_7611151947b52a71323a46ea46"`); + await queryRunner.query(`DROP INDEX "public"."IDX_f033e95537c91a7787c7a07c85"`); + await queryRunner.query( + `ALTER TABLE "project" RENAME COLUMN "trier_level_id" TO "tier_level_id"`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" DROP CONSTRAINT "FK_8988a5dafec2270a5191a1208cd"`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" DROP CONSTRAINT "FK_c9230eab8c7df3197b3c96dcac6"`, + ); + await queryRunner.query(`DROP INDEX "public"."IDX_e96934a5a81124580dd628602f"`); + await queryRunner.query( + `ALTER TABLE "notification_queue" ALTER COLUMN "project_id" DROP NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" ALTER COLUMN "to_agency_id" DROP NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "project_agency_response" DROP CONSTRAINT "FK_67989daa98d90fafc2087a4871f"`, + ); + await queryRunner.query( + `ALTER TABLE "project_agency_response" ALTER COLUMN "notification_id" DROP NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "project_property" DROP CONSTRAINT "FK_b2229cb8dfee8d1c2fe6b78bd91"`, + ); + await queryRunner.query( + `ALTER TABLE "project_property" DROP CONSTRAINT "FK_d18ff54ded63e964ef42a66880e"`, + ); + await queryRunner.query(`DROP INDEX "public"."IDX_ef992ea03a65f72e0b69644b35"`); + await queryRunner.query( + `ALTER TABLE "project_property" ALTER COLUMN "parcel_id" DROP NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "project_property" ALTER COLUMN "building_id" DROP NOT NULL`, + ); + await queryRunner.query(`DROP INDEX "public"."IDX_e4998c66591ebea5e8c1c2d575"`); + await queryRunner.query(`ALTER TABLE "project_report" ALTER COLUMN "from" DROP NOT NULL`); + await queryRunner.query( + `CREATE INDEX "IDX_88df15c457daadc1d407c6d085" ON "project" ("tier_level_id") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_5d29806a012b84ac1d014c563d" ON "project" ("status_id", "tier_level_id", "agency_id") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e96934a5a81124580dd628602f" ON "notification_queue" ("project_id", "template_id", "to_agency_id") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_ef992ea03a65f72e0b69644b35" ON "project_property" ("project_id", "property_type_id", "parcel_id", "building_id") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e4998c66591ebea5e8c1c2d575" ON "project_report" ("id", "to", "from", "is_final") `, + ); + await queryRunner.query( + `ALTER TABLE "project" ADD CONSTRAINT "FK_88df15c457daadc1d407c6d085f" FOREIGN KEY ("tier_level_id") REFERENCES "tier_level"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" ADD CONSTRAINT "FK_8988a5dafec2270a5191a1208cd" FOREIGN KEY ("project_id") REFERENCES "project"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" ADD CONSTRAINT "FK_c9230eab8c7df3197b3c96dcac6" FOREIGN KEY ("to_agency_id") REFERENCES "agency"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "project_agency_response" ADD CONSTRAINT "FK_67989daa98d90fafc2087a4871f" FOREIGN KEY ("notification_id") REFERENCES "notification_queue"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "project_property" ADD CONSTRAINT "FK_b2229cb8dfee8d1c2fe6b78bd91" FOREIGN KEY ("parcel_id") REFERENCES "parcel"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "project_property" ADD CONSTRAINT "FK_d18ff54ded63e964ef42a66880e" FOREIGN KEY ("building_id") REFERENCES "building"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + } + + public async down(queryRunner: QueryRunner): Promise { + await queryRunner.query( + `ALTER TABLE "project_property" DROP CONSTRAINT "FK_d18ff54ded63e964ef42a66880e"`, + ); + await queryRunner.query( + `ALTER TABLE "project_property" DROP CONSTRAINT "FK_b2229cb8dfee8d1c2fe6b78bd91"`, + ); + await queryRunner.query( + `ALTER TABLE "project_agency_response" DROP CONSTRAINT "FK_67989daa98d90fafc2087a4871f"`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" DROP CONSTRAINT "FK_c9230eab8c7df3197b3c96dcac6"`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" DROP CONSTRAINT "FK_8988a5dafec2270a5191a1208cd"`, + ); + await queryRunner.query( + `ALTER TABLE "project" DROP CONSTRAINT "FK_88df15c457daadc1d407c6d085f"`, + ); + await queryRunner.query(`DROP INDEX "public"."IDX_e4998c66591ebea5e8c1c2d575"`); + await queryRunner.query(`DROP INDEX "public"."IDX_ef992ea03a65f72e0b69644b35"`); + await queryRunner.query(`DROP INDEX "public"."IDX_e96934a5a81124580dd628602f"`); + await queryRunner.query(`DROP INDEX "public"."IDX_5d29806a012b84ac1d014c563d"`); + await queryRunner.query(`DROP INDEX "public"."IDX_88df15c457daadc1d407c6d085"`); + await queryRunner.query(`ALTER TABLE "project_report" ALTER COLUMN "from" SET NOT NULL`); + await queryRunner.query( + `CREATE INDEX "IDX_e4998c66591ebea5e8c1c2d575" ON "project_report" ("id", "is_final", "from", "to") `, + ); + await queryRunner.query( + `ALTER TABLE "project_property" ALTER COLUMN "building_id" SET NOT NULL`, + ); + await queryRunner.query(`ALTER TABLE "project_property" ALTER COLUMN "parcel_id" SET NOT NULL`); + await queryRunner.query( + `CREATE INDEX "IDX_ef992ea03a65f72e0b69644b35" ON "project_property" ("project_id", "property_type_id", "parcel_id", "building_id") `, + ); + await queryRunner.query( + `ALTER TABLE "project_property" ADD CONSTRAINT "FK_d18ff54ded63e964ef42a66880e" FOREIGN KEY ("building_id") REFERENCES "building"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "project_property" ADD CONSTRAINT "FK_b2229cb8dfee8d1c2fe6b78bd91" FOREIGN KEY ("parcel_id") REFERENCES "parcel"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "project_agency_response" ALTER COLUMN "notification_id" SET NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "project_agency_response" ADD CONSTRAINT "FK_67989daa98d90fafc2087a4871f" FOREIGN KEY ("notification_id") REFERENCES "notification_queue"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" ALTER COLUMN "to_agency_id" SET NOT NULL`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" ALTER COLUMN "project_id" SET NOT NULL`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_e96934a5a81124580dd628602f" ON "notification_queue" ("project_id", "to_agency_id", "template_id") `, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" ADD CONSTRAINT "FK_c9230eab8c7df3197b3c96dcac6" FOREIGN KEY ("to_agency_id") REFERENCES "agency"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "notification_queue" ADD CONSTRAINT "FK_8988a5dafec2270a5191a1208cd" FOREIGN KEY ("project_id") REFERENCES "project"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + await queryRunner.query( + `ALTER TABLE "project" RENAME COLUMN "tier_level_id" TO "trier_level_id"`, + ); + await queryRunner.query( + `CREATE INDEX "IDX_f033e95537c91a7787c7a07c85" ON "project" ("trier_level_id") `, + ); + await queryRunner.query( + `CREATE INDEX "IDX_7611151947b52a71323a46ea46" ON "project" ("agency_id", "trier_level_id", "status_id") `, + ); + await queryRunner.query( + `ALTER TABLE "project" ADD CONSTRAINT "FK_f033e95537c91a7787c7a07c857" FOREIGN KEY ("trier_level_id") REFERENCES "tier_level"("id") ON DELETE NO ACTION ON UPDATE NO ACTION`, + ); + } +} diff --git a/tools/dbeaver/tasks.json b/tools/dbeaver/tasks.json index 9450cb4b7..89b087eb4 100644 --- a/tools/dbeaver/tasks.json +++ b/tools/dbeaver/tasks.json @@ -104,29 +104,27 @@ { "type": "databaseTransferProducer", "location": { - "type": "entity", + "type": "query", "project": "General", - "entityId": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/Projects" + "dataSource": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539", + "defaultCatalog": "pims", + "query": "\r\nSELECT [ProjectId]\r\n ,[TaskId]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[IsCompleted]\r\n ,[CompletedOn]\r\n FROM [dbo].[ProjectTasks]" } }, { "type": "databaseTransferProducer", "location": { - "type": "query", + "type": "entity", "project": "General", - "dataSource": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539", - "defaultCatalog": "pims", - "query": "\r\nSELECT [ProjectId]\r\n ,[TaskId]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[IsCompleted]\r\n ,[CompletedOn]\r\n FROM [dbo].[ProjectTasks]" + "entityId": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/Projects" } }, { "type": "databaseTransferProducer", "location": { - "type": "query", + "type": "entity", "project": "General", - "dataSource": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539", - "defaultCatalog": "pims", - "query": "SELECT [Id]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[IsFinal]\r\n ,[Name]\r\n ,[From]\r\n ,[To]\r\n ,[ReportType]\r\n FROM [dbo].[ProjectReports]" + "entityId": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectStatusHistory" } }, { @@ -142,7 +140,7 @@ "location": { "type": "entity", "project": "General", - "entityId": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectStatusHistory" + "entityId": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectNumbers" } }, { @@ -160,15 +158,17 @@ "project": "General", "dataSource": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539", "defaultCatalog": "pims", - "query": "\r\nSELECT [ProjectId]\r\n ,[AgencyId]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[OfferAmount]\r\n ,[NotificationId]\r\n ,[Response]\r\n ,[ReceivedOn]\r\n ,[Note]\r\n FROM [dbo].[ProjectAgencyResponses]" + "query": "SELECT [Id]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[IsFinal]\r\n ,[Name]\r\n ,[From]\r\n ,[To]\r\n ,[ReportType]\r\n FROM [dbo].[ProjectReports]" } }, { "type": "databaseTransferProducer", "location": { - "type": "entity", + "type": "query", "project": "General", - "entityId": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectNumbers" + "dataSource": "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539", + "defaultCatalog": "pims", + "query": "\r\nSELECT [ProjectId]\r\n ,[AgencyId]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[OfferAmount]\r\n ,[NotificationId]\r\n ,[Response]\r\n ,[ReceivedOn]\r\n ,[Note]\r\n FROM [dbo].[ProjectAgencyResponses]" } }, { @@ -286,7 +286,7 @@ "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing", "transformer": "constant", "transformerProperties": { @@ -295,15 +295,15 @@ "transformerPropertiesNames": "constant" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", + "targetName": "updated_on", "mappingType": "existing" }, "rowversion": { @@ -311,15 +311,15 @@ "mappingType": "skip" }, "Name": { - "targetName": "\"Name\"", + "targetName": "name", "mappingType": "existing" }, "isdisabled": { - "targetName": "\"IsDisabled\"", + "targetName": "is_disabled", "mappingType": "existing" }, "sortorder": { - "targetName": "\"SortOrder\"", + "targetName": "sort_order", "mappingType": "existing" }, "code": { @@ -331,7 +331,7 @@ "mappingType": "existing" }, "parentid": { - "targetName": "\"ParentId\"", + "targetName": "parent_id", "mappingType": "existing" }, "email": { @@ -339,127 +339,139 @@ "mappingType": "existing" }, "sendemail": { - "targetName": "\"SendEmail\"", + "targetName": "send_email", "mappingType": "existing" }, "addressto": { - "targetName": "\"AddressTo\"", + "targetName": "address_to", "mappingType": "existing" }, "ccemail": { - "targetName": "\"CCEmail\"", + "targetName": "cc_email", "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT \r\n u.[Id],\r\n \r\n\t CASE \r\n\t\tWHEN u.[CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE u.[CreatedById]\r\n\t END AS [CreatedById],\r\n \r\n\t CASE \r\n\t\tWHEN u.IsDisabled \u003d 0 THEN \u0027Active\u0027\r\n\t\tELSE \u0027Disabled\u0027\r\n\t END AS [Status],\r\n u.[UpdatedById],\r\n u.[UpdatedOn],\r\n u.[Username],\r\n u.[DisplayName],\r\n u.[FirstName],\r\n u.[MiddleName],\r\n u.[LastName],\r\n u.[Email],\r\n u.[Position],\r\n u.[IsDisabled],\r\n u.[EmailVerified],\r\n u.[Note],\r\n u.[IsSystem],\r\n u.[LastLogin],\r\n u.[ApprovedById],\r\n u.[ApprovedOn],\r\n u.[KeycloakUserId],\r\n urd.CreatedOn,\r\n urd.UserId,\r\n ua.AgencyId, \r\n STRING_AGG(urd.RoleName, \u0027, \u0027) AS Roles,\r\n CASE \r\n WHEN STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%System Administrator%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%SRES%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%SRES Financial Reporter%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%SRES Financial%\u0027 THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n \r\n WHEN STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Agency Administrator%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Real Estate Analyst%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Real Estate Manager%\u0027 THEN \u002700000000-0000-0000-0000-000000000001\u0027\r\n \r\n WHEN STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Assistant Deputy Minister Assistant%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Assistant Deputy Minister%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Executive Director%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%View Only Properties%\u0027 THEN \u002700000000-0000-0000-0000-000000000002\u0027\r\n\t \r\n END AS UserType\r\nFROM Users u\r\nLEFT JOIN (\r\n SELECT \r\n ur.UserId,\r\n MAX(ur.CreatedOn) AS CreatedOn,\r\n STRING_AGG(r.Name, \u0027, \u0027) AS RoleName\r\n FROM [pims].[dbo].[UserRoles] ur\r\n INNER JOIN Roles r ON ur.RoleId \u003d r.Id\r\n GROUP BY ur.UserId\r\n) AS urd ON u.Id \u003d urd.UserId\r\n\r\nLEFT OUTER JOIN (\r\n SELECT UserId, MIN(AgencyId) AS AgencyId\r\n FROM UserAgencies\r\n GROUP BY UserId\r\n) ua_min ON u.Id \u003d ua_min.UserId\r\nLEFT OUTER JOIN UserAgencies ua ON u.Id \u003d ua.UserId AND ua.AgencyId \u003d ua_min.AgencyId\r\n\r\nWHERE u.Id \u003c\u003e \u002700000000-0000-0000-0000-000000000000\u0027\r\n\r\nGROUP BY u.[Id],\r\n u.[CreatedById],\r\n u.[UpdatedById],\r\n u.[UpdatedOn],\r\n u.[Username],\r\n u.[DisplayName],\r\n u.[FirstName],\r\n u.[MiddleName],\r\n u.[LastName],\r\n u.[Email],\r\n u.[Position],\r\n u.[IsDisabled],\r\n u.[EmailVerified],\r\n u.[Note],\r\n u.[IsSystem],\r\n u.[LastLogin],\r\n u.[ApprovedById],\r\n u.[ApprovedOn],\r\n u.[KeycloakUserId],\r\n urd.CreatedOn, \r\n urd.UserId, \r\n ua.AgencyId\r\nORDER BY urd.CreatedOn ASC": { - "targetName": "user", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/Projects": { + "targetName": "project", "mappingType": "existing", "attributes": { "id": { - "targetName": "id", + "targetName": "\"Id\"", "mappingType": "existing" }, "createdbyid": { - "targetName": "createdbyid", + "targetName": "created_by_id", "mappingType": "existing" }, - "status": { - "targetName": "status", + "createdon": { + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "updatedbyid", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "updatedon", + "targetName": "updated_on", "mappingType": "existing" }, - "username": { - "targetName": "username", + "rowversion": { + "targetName": "\"RowVersion\"", + "mappingType": "skip" + }, + "projectnumber": { + "targetName": "project_number", "mappingType": "existing" }, - "displayname": { - "targetName": "displayname", + "Name": { + "targetName": "\"Name\"", "mappingType": "existing" }, - "firstname": { - "targetName": "firstname", + "workflowid": { + "targetName": "workflow_id", "mappingType": "existing" }, - "middlename": { - "targetName": "middlename", + "manager": { + "targetName": "\"Manager\"", "mappingType": "existing" }, - "lastname": { - "targetName": "lastname", + "reportedfiscalyear": { + "targetName": "reported_fiscal_year", "mappingType": "existing" }, - "email": { - "targetName": "email", + "actualfiscalyear": { + "targetName": "actual_fiscal_year", "mappingType": "existing" }, - "Position": { - "targetName": "Position", + "agencyid": { + "targetName": "agency_id", "mappingType": "existing" }, - "isdisabled": { - "targetName": "isdisabled", + "statusid": { + "targetName": "status_id", "mappingType": "existing" }, - "emailverified": { - "targetName": "emailverified", + "description": { + "targetName": "\"Description\"", "mappingType": "existing" }, - "note": { - "targetName": "note", + "tierlevelid": { + "targetName": "tier_level_id", "mappingType": "existing" }, - "issystem": { - "targetName": "issystem", + "riskid": { + "targetName": "risk_id", "mappingType": "existing" }, - "lastlogin": { - "targetName": "lastlogin", + "metadata": { + "targetName": "\"Metadata\"", "mappingType": "existing" }, - "approvedbyid": { - "targetName": "approvedbyid", + "submittedon": { + "targetName": "submitted_on", "mappingType": "existing" }, "approvedon": { - "targetName": "approvedon", + "targetName": "approved_on", "mappingType": "existing" }, - "keycloakuserid": { - "targetName": "keycloakuserid", + "deniedon": { + "targetName": "denied_on", "mappingType": "existing" }, - "createdon": { - "targetName": "createdon", + "cancelledon": { + "targetName": "cancelled_on", "mappingType": "existing" }, - "userid": { - "targetName": "userid", - "mappingType": "skip" + "completedon": { + "targetName": "completed_on", + "mappingType": "existing" }, - "agencyid": { - "targetName": "agencyid", + "netbook": { + "targetName": "net_book", "mappingType": "existing" }, - "roles": { - "targetName": "roles", - "mappingType": "skip" + "market": { + "targetName": "\"Market\"", + "mappingType": "existing" }, - "usertype": { - "targetName": "\"RoleId\"", + "assessed": { + "targetName": "\"Assessed\"", + "mappingType": "existing" + }, + "appraised": { + "targetName": "\"Appraised\"", + "mappingType": "existing" + }, + "projecttype": { + "targetName": "project_type", "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT p.[Id],\r\n\t CASE \r\n\t\tWHEN p.[CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE p.[CreatedById]\r\n\t END AS [CreatedById],\r\n p.[CreatedOn],\r\n p.[UpdatedById],\r\n p.[UpdatedOn],\r\n p.[Name],\r\n p.[Description],\r\n p.[ClassificationId],\r\n p.[AgencyId],\r\n p.[IsSensitive],\r\n p.[IsVisibleToOtherAgencies],\r\n p.[PID],\r\n p.[PIN],\r\n p.[LandArea],\r\n p.[LandLegalDescription],\r\n p.[Zoning],\r\n p.[ZoningPotential],\r\n p.[NotOwned],\r\n\tCONVERT(VARCHAR(40), CAST(Location.Long AS DECIMAL(18, 14))) + \u0027, \u0027 + CONVERT(VARCHAR(40), CAST(Location.Lat AS DECIMAL(18, 14))) AS Location,\r\n CASE \r\n WHEN a.AdministrativeArea \u003d \u0027The Corporation of the City of Nelson\u0027 THEN 188\r\n WHEN a.AdministrativeArea \u003d \u0027Township of Langley\u0027 THEN 150\r\n WHEN a.AdministrativeArea \u003d \u0027District of North Vancouver\u0027 THEN 196\r\n WHEN a.AdministrativeArea \u003d \u0027Coombs\u0027 THEN 483\r\n WHEN a.AdministrativeArea \u003d \u0027Brookmere\u0027 THEN 481\r\n WHEN a.AdministrativeArea \u003d \u0027Thornhill\u0027 THEN 501\r\n WHEN a.AdministrativeArea \u003d \u0027Two Mile\u0027 THEN 502\r\n WHEN a.AdministrativeArea \u003d \u0027Crofton\u0027 THEN 484\r\n WHEN a.AdministrativeArea \u003d \u0027East Sooke\u0027 THEN 485\r\n WHEN a.AdministrativeArea \u003d \u0027Mudge Island\u0027 THEN 492\r\n WHEN a.AdministrativeArea \u003d \u0027Coal Harbour\u0027 THEN 482\r\n WHEN a.AdministrativeArea \u003d \u0027Miworth\u0027 THEN 490\r\n WHEN a.AdministrativeArea \u003d \u0027Lake Errock\u0027 THEN 489\r\n WHEN a.AdministrativeArea \u003d \u0027Black Creek\u0027 THEN 479\r\n WHEN a.AdministrativeArea \u003d \u0027Whaletown\u0027 THEN 504\r\n WHEN a.AdministrativeArea \u003d \u0027Quathiaski Cove\u0027 THEN 494\r\n WHEN a.AdministrativeArea \u003d \u0027Big Bay in Stuart Island\u0027 THEN 478\r\n WHEN a.AdministrativeArea \u003d \u0027Surge Narrows in Read Island\u0027 THEN 500\r\n WHEN a.AdministrativeArea \u003d \u0027Rock Bay in Sayward\u0027 THEN 497\r\n WHEN a.AdministrativeArea \u003d \u0027Granite Bay in Quadra Island\u0027 THEN 487\r\n WHEN a.AdministrativeArea \u003d \u0027Moberly Lake\u0027 THEN 491\r\n WHEN a.AdministrativeArea \u003d \u0027Quatsino\u0027 THEN 495\r\n WHEN a.AdministrativeArea \u003d \u0027Bouchie Lake\u0027 THEN 480\r\n WHEN a.AdministrativeArea \u003d \u0027West Lake\u0027 THEN 503\r\n WHEN a.AdministrativeArea \u003d \u0027Salmon Valley\u0027 THEN 498\t\t\r\n WHEN a.AdministrativeArea \u003d \u0027Red Rock\u0027 THEN 496\r\n WHEN a.AdministrativeArea \u003d \u0027Stoner\u0027 THEN 499\r\n WHEN a.AdministrativeArea \u003d \u0027Pineview FFG\u0027 THEN 493\r\n WHEN a.AdministrativeArea \u003d \u0027Wonowon\u0027 THEN 506\r\n WHEN a.AdministrativeArea \u003d \u0027Halfway River\u0027 THEN 488\r\n WHEN a.AdministrativeArea \u003d \u0027Giscome\u0027 THEN 486\r\n WHEN a.AdministrativeArea \u003d \u0027Willow River\u0027 THEN 505\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Lower Nicola\u0027 THEN 314\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Belcarra\u0027 THEN 425\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Tsawwassen\u0027 THEN 315\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Anmore\u0027 THEN 432\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Lake Cowichan\u0027 THEN 442\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027North Cowichan\u0027 THEN 450\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Port Edward\u0027 THEN 347\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Spallumcheen\u0027 THEN 318\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Jumbo Glacier Mountain Resort Municipality\u0027 THEN 438\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Kent\u0027 THEN 439\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Highlands\u0027 THEN 348\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Slocan\u0027 THEN 380\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Warfield\u0027 THEN 448\r\n ELSE aa.Id \r\n END AS AdministrativeAreaId, \r\n\ta.AdministrativeArea,\r\n\ta.Address1, \r\n\ta.Postal,\r\n\tpp.ParcelId as ParentID,\r\n\t0 as PropertyTypeID\r\nFROM \r\n [pims].[dbo].[Parcels] p\r\n\tINNER JOIN Addresses a\r\n\tON p.AddressId \u003d a.Id\r\n\tLEFT OUTER JOIN AdministrativeAreas aa\r\n\tON aa.Name \u003d a.AdministrativeArea\r\n    LEFT OUTER JOIN ParcelParcels pp\r\n    ON pp.SubdivisionId \u003d p.Id": { - "targetName": "parcel", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectStatusHistory": { + "targetName": "project_status_history", "mappingType": "existing", "attributes": { "id": { @@ -467,105 +479,99 @@ "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", - "mappingType": "existing" - }, - "Name": { - "targetName": "\"Name\"", - "mappingType": "existing" - }, - "description": { - "targetName": "\"Description\"", + "targetName": "updated_on", "mappingType": "existing" }, - "classificationid": { - "targetName": "\"ClassificationId\"", - "mappingType": "existing" + "rowversion": { + "targetName": "\"RowVersion\"", + "mappingType": "skip" }, - "agencyid": { - "targetName": "\"AgencyId\"", + "projectid": { + "targetName": "project_id", "mappingType": "existing" }, - "issensitive": { - "targetName": "\"IsSensitive\"", + "workflowid": { + "targetName": "workflow_id", "mappingType": "existing" }, - "isvisibletootheragencies": { - "targetName": "\"IsVisibleToOtherAgencies\"", + "statusid": { + "targetName": "status_id", "mappingType": "existing" - }, - "pid": { - "targetName": "\"PID\"", + } + } + }, + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectSnapshots": { + "targetName": "project_snapshot", + "mappingType": "existing", + "attributes": { + "id": { + "targetName": "\"Id\"", "mappingType": "existing" }, - "pin": { - "targetName": "\"PIN\"", + "createdbyid": { + "targetName": "created_by_id", "mappingType": "existing" }, - "landarea": { - "targetName": "\"LandArea\"", + "createdon": { + "targetName": "created_on", "mappingType": "existing" }, - "landlegaldescription": { - "targetName": "\"LandLegalDescription\"", + "updatedbyid": { + "targetName": "updated_by_id", "mappingType": "existing" }, - "zoning": { - "targetName": "\"Zoning\"", + "updatedon": { + "targetName": "updated_on", "mappingType": "existing" }, - "zoningpotential": { - "targetName": "\"ZoningPotential\"", - "mappingType": "existing" + "rowversion": { + "targetName": "\"RowVersion\"", + "mappingType": "skip" }, - "notowned": { - "targetName": "\"NotOwned\"", + "projectid": { + "targetName": "project_id", "mappingType": "existing" }, - "Location": { - "targetName": "\"Location\"", + "netbook": { + "targetName": "net_book", "mappingType": "existing" }, - "administrativeareaid": { - "targetName": "\"AdministrativeAreaId\"", + "market": { + "targetName": "\"Market\"", "mappingType": "existing" }, - "administrativearea": { - "targetName": "\"AdministrativeArea\"", - "mappingType": "skip" - }, - "address1": { - "targetName": "\"Address1\"", + "assessed": { + "targetName": "\"Assessed\"", "mappingType": "existing" }, - "postal": { - "targetName": "\"Postal\"", + "appraised": { + "targetName": "\"Appraised\"", "mappingType": "existing" }, - "parentid": { - "targetName": "\"ParentParcelId\"", + "snapshoton": { + "targetName": "snapshot_on", "mappingType": "existing" }, - "propertytypeid": { - "targetName": "\"PropertyTypeID\"", + "metadata": { + "targetName": "\"Metadata\"", "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT p.[Id],\r\n\tCASE \r\n\t WHEN p.[CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t ELSE p.[CreatedById]\r\n\tEND AS [CreatedById],\r\n p.[CreatedOn],\r\n p.[UpdatedById],\r\n p.[UpdatedOn],\r\n p.[Name],\r\n p.[Description],\r\n p.[ClassificationId],\r\n p.BuildingConstructionTypeId,\r\n p.[AgencyId],\r\n p.[IsSensitive],\r\n p.[IsVisibleToOtherAgencies],\r\n\tp.BuildingFloorCount,\r\n\tp.BuildingPredominateUseId,\r\n\tp.BuildingTenancy,\r\n\tp.RentableArea,\r\n\tp.BuildingOccupantTypeId,\r\n\tp.LeaseExpiry,\r\n\tp.OccupantName,\r\n\tp.TransferLeaseOnSale,\r\n\tp.BuildingTenancyUpdatedOn,\r\n\tp.EncumbranceReason,\r\n\tp.LeasedLandMetadata,\r\n\tp.TotalArea,\r\n\tCONVERT(VARCHAR(40), CAST(Location.Long AS DECIMAL(18, 14))) + \u0027, \u0027 + CONVERT(VARCHAR(40), CAST(Location.Lat AS DECIMAL(18, 14))) AS Location,\r\n\tCASE \r\n WHEN a.AdministrativeArea \u003d \u0027The Corporation of the City of Nelson\u0027 THEN 188\r\n WHEN a.AdministrativeArea \u003d \u0027Township of Langley\u0027 THEN 150\r\n WHEN a.AdministrativeArea \u003d \u0027District of North Vancouver\u0027 THEN 196\r\n WHEN a.AdministrativeArea \u003d \u0027Coombs\u0027 THEN 483\r\n WHEN a.AdministrativeArea \u003d \u0027Brookmere\u0027 THEN 481\r\n WHEN a.AdministrativeArea \u003d \u0027Thornhill\u0027 THEN 501\r\n WHEN a.AdministrativeArea \u003d \u0027Two Mile\u0027 THEN 502\r\n WHEN a.AdministrativeArea \u003d \u0027Crofton\u0027 THEN 484\r\n WHEN a.AdministrativeArea \u003d \u0027East Sooke\u0027 THEN 485\r\n WHEN a.AdministrativeArea \u003d \u0027Mudge Island\u0027 THEN 492\r\n WHEN a.AdministrativeArea \u003d \u0027Coal Harbour\u0027 THEN 482\r\n WHEN a.AdministrativeArea \u003d \u0027Miworth\u0027 THEN 490\r\n WHEN a.AdministrativeArea \u003d \u0027Lake Errock\u0027 THEN 489\r\n WHEN a.AdministrativeArea \u003d \u0027Black Creek\u0027 THEN 479\r\n WHEN a.AdministrativeArea \u003d \u0027Whaletown\u0027 THEN 504\r\n WHEN a.AdministrativeArea \u003d \u0027Quathiaski Cove\u0027 THEN 494\r\n WHEN a.AdministrativeArea \u003d \u0027Big Bay in Stuart Island\u0027 THEN 478\r\n WHEN a.AdministrativeArea \u003d \u0027Surge Narrows in Read Island\u0027 THEN 500\r\n WHEN a.AdministrativeArea \u003d \u0027Rock Bay in Sayward\u0027 THEN 497\r\n WHEN a.AdministrativeArea \u003d \u0027Granite Bay in Quadra Island\u0027 THEN 487\r\n WHEN a.AdministrativeArea \u003d \u0027Moberly Lake\u0027 THEN 491\r\n WHEN a.AdministrativeArea \u003d \u0027Quatsino\u0027 THEN 495\r\n WHEN a.AdministrativeArea \u003d \u0027Bouchie Lake\u0027 THEN 480\r\n WHEN a.AdministrativeArea \u003d \u0027West Lake\u0027 THEN 503\r\n WHEN a.AdministrativeArea \u003d \u0027Salmon Valley\u0027 THEN 498\t\t\r\n WHEN a.AdministrativeArea \u003d \u0027Red Rock\u0027 THEN 496\r\n WHEN a.AdministrativeArea \u003d \u0027Stoner\u0027 THEN 499\r\n WHEN a.AdministrativeArea \u003d \u0027Pineview FFG\u0027 THEN 493\r\n WHEN a.AdministrativeArea \u003d \u0027Wonowon\u0027 THEN 506\r\n WHEN a.AdministrativeArea \u003d \u0027Halfway River\u0027 THEN 488\r\n WHEN a.AdministrativeArea \u003d \u0027Giscome\u0027 THEN 486\r\n WHEN a.AdministrativeArea \u003d \u0027Willow River\u0027 THEN 505\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Lower Nicola\u0027 THEN 314\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Belcarra\u0027 THEN 425\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Tsawwassen\u0027 THEN 315\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Anmore\u0027 THEN 432\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Lake Cowichan\u0027 THEN 442\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027North Cowichan\u0027 THEN 450\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Port Edward\u0027 THEN 347\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Spallumcheen\u0027 THEN 318\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Jumbo Glacier Mountain Resort Municipality\u0027 THEN 438\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Kent\u0027 THEN 439\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Highlands\u0027 THEN 348\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Slocan\u0027 THEN 380\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Warfield\u0027 THEN 448\r\n ELSE aa.Id \r\n END AS AdministrativeAreaId, \r\n\ta.Address1, \r\n\ta.Postal,\r\n\t1 as PropertyTypeID\r\nFROM \r\n [pims].[dbo].Buildings p\r\n\tINNER JOIN Addresses a\r\n\tON p.AddressId \u003d a.Id\r\n\tLEFT OUTER JOIN AdministrativeAreas aa\r\n\tON aa.Name \u003d a.AdministrativeArea\r\nWHERE p.BuildingPredominateUseId \u003c\u003d 54": { - "targetName": "building", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectProperties": { + "targetName": "project_property", "mappingType": "existing", "attributes": { "id": { @@ -573,719 +579,711 @@ "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", + "targetName": "updated_on", "mappingType": "existing" }, - "Name": { - "targetName": "\"Name\"", - "mappingType": "existing" + "rowversion": { + "targetName": "\"RowVersion\"", + "mappingType": "skip" }, - "description": { - "targetName": "\"Description\"", + "projectid": { + "targetName": "project_id", "mappingType": "existing" }, - "classificationid": { - "targetName": "\"ClassificationId\"", + "propertytype": { + "targetName": "property_type_id", "mappingType": "existing" }, - "buildingconstructiontypeid": { - "targetName": "\"BuildingConstructionTypeId\"", + "parcelid": { + "targetName": "parcel_id", "mappingType": "existing" }, - "agencyid": { - "targetName": "\"AgencyId\"", + "buildingid": { + "targetName": "building_id", "mappingType": "existing" - }, - "issensitive": { - "targetName": "\"IsSensitive\"", + } + } + }, + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectNumbers": { + "targetName": "project_number", + "mappingType": "existing", + "attributes": { + "id": { + "targetName": "\"Id\"", "mappingType": "existing" }, - "isvisibletootheragencies": { - "targetName": "\"IsVisibleToOtherAgencies\"", + "createdbyid": { + "targetName": "created_by_id", "mappingType": "existing" }, - "buildingfloorcount": { - "targetName": "\"BuildingFloorCount\"", + "createdon": { + "targetName": "created_on", "mappingType": "existing" }, - "buildingpredominateuseid": { - "targetName": "\"BuildingPredominateUseId\"", + "updatedbyid": { + "targetName": "updated_by_id", "mappingType": "existing" }, - "buildingtenancy": { - "targetName": "\"BuildingTenancy\"", + "updatedon": { + "targetName": "updated_on", "mappingType": "existing" }, - "rentablearea": { - "targetName": "\"RentableArea\"", + "rowversion": { + "targetName": "\"RowVersion\"", + "mappingType": "skip" + } + } + }, + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/NotificationQueue": { + "targetName": "notification_queue", + "mappingType": "existing", + "attributes": { + "id": { + "targetName": "\"Id\"", "mappingType": "existing" }, - "buildingoccupanttypeid": { - "targetName": "\"BuildingOccupantTypeId\"", + "createdbyid": { + "targetName": "created_by_id", "mappingType": "existing" }, - "leaseexpiry": { - "targetName": "\"LeaseExpiry\"", + "createdon": { + "targetName": "created_on", "mappingType": "existing" }, - "occupantname": { - "targetName": "\"OccupantName\"", + "updatedbyid": { + "targetName": "updated_by_id", "mappingType": "existing" }, - "transferleaseonsale": { - "targetName": "\"TransferLeaseOnSale\"", + "updatedon": { + "targetName": "updated_on", "mappingType": "existing" }, - "buildingtenancyupdatedon": { - "targetName": "\"BuildingTenancyUpdatedOn\"", + "rowversion": { + "targetName": "\"RowVersion\"", + "mappingType": "skip" + }, + "Key": { + "targetName": "\"Key\"", "mappingType": "existing" }, - "encumbrancereason": { - "targetName": "\"EncumbranceReason\"", + "status": { + "targetName": "\"Status\"", "mappingType": "existing" }, - "leasedlandmetadata": { - "targetName": "\"LeasedLandMetadata\"", + "priority": { + "targetName": "\"Priority\"", "mappingType": "existing" }, - "totalarea": { - "targetName": "\"TotalArea\"", + "Encoding": { + "targetName": "\"Encoding\"", "mappingType": "existing" }, - "Location": { - "targetName": "\"Location\"", + "sendon": { + "targetName": "send_on", "mappingType": "existing" }, - "administrativeareaid": { - "targetName": "\"AdministrativeAreaId\"", + "To": { + "targetName": "\"To\"", "mappingType": "existing" }, - "address1": { - "targetName": "\"Address1\"", + "subject": { + "targetName": "\"Subject\"", "mappingType": "existing" }, - "postal": { - "targetName": "\"Postal\"", + "bodytype": { + "targetName": "body_type", "mappingType": "existing" }, - "propertytypeid": { - "targetName": "\"PropertyTypeID\"", + "body": { + "targetName": "\"Body\"", "mappingType": "existing" - } - } - }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT pb.*\r\n FROM [pims].[dbo].ParcelBuildings pb\r\n INNER JOIN Buildings b\r\n ON b.Id \u003d pb.BuildingId\r\n WHERE b.BuildingPredominateUseId \u003c\u003d 54": { - "targetName": "parcel_building", - "mappingType": "existing", - "attributes": { - "parcelid": { - "targetName": "\"ParcelId\"", + }, + "bcc": { + "targetName": "\"Bcc\"", "mappingType": "existing" }, - "buildingid": { - "targetName": "\"BuildingId\"", + "cc": { + "targetName": "\"Cc\"", "mappingType": "existing" }, - "createdbyid": { - "targetName": "\"CreatedById\"", + "tag": { + "targetName": "\"Tag\"", "mappingType": "existing" }, - "createdon": { - "targetName": "\"CreatedOn\"", + "projectid": { + "targetName": "project_id", "mappingType": "existing" }, - "updatedbyid": { - "targetName": "\"UpdatedById\"", + "toagencyid": { + "targetName": "to_agency_id", "mappingType": "existing" }, - "updatedon": { - "targetName": "\"UpdatedOn\"", + "templateid": { + "targetName": "template_id", "mappingType": "existing" }, - "rowversion": { - "targetName": "\"RowVersion\"", - "mappingType": "skip" + "chesmessageid": { + "targetName": "ches_message_id", + "mappingType": "existing" + }, + "chestransactionid": { + "targetName": "ches_transaction_id", + "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [ParcelId]\r\n ,[Date]\r\n ,[Key]\r\n ,\r\n\t CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[Firm]\r\n ,[Value]\r\n ,[Note]\r\n FROM [pims].[dbo].[ParcelEvaluations]": { - "targetName": "parcel_evaluation", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT \r\n u.[Id],\r\n \r\n\t CASE \r\n\t\tWHEN u.[CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE u.[CreatedById]\r\n\t END AS [CreatedById],\r\n \r\n\t CASE \r\n\t\tWHEN u.IsDisabled \u003d 0 THEN \u0027Active\u0027\r\n\t\tELSE \u0027Disabled\u0027\r\n\t END AS [Status],\r\n u.[UpdatedById],\r\n u.[UpdatedOn],\r\n u.[Username],\r\n u.[DisplayName],\r\n u.[FirstName],\r\n u.[MiddleName],\r\n u.[LastName],\r\n u.[Email],\r\n u.[Position],\r\n u.[IsDisabled],\r\n u.[EmailVerified],\r\n u.[Note],\r\n u.[IsSystem],\r\n u.[LastLogin],\r\n u.[ApprovedById],\r\n u.[ApprovedOn],\r\n u.[KeycloakUserId],\r\n urd.CreatedOn,\r\n urd.UserId,\r\n ua.AgencyId, \r\n STRING_AGG(urd.RoleName, \u0027, \u0027) AS Roles,\r\n CASE \r\n WHEN STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%System Administrator%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%SRES%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%SRES Financial Reporter%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%SRES Financial%\u0027 THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n \r\n WHEN STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Agency Administrator%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Real Estate Analyst%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Real Estate Manager%\u0027 THEN \u002700000000-0000-0000-0000-000000000001\u0027\r\n \r\n WHEN STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Assistant Deputy Minister Assistant%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Assistant Deputy Minister%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%Executive Director%\u0027\r\n OR STRING_AGG(urd.RoleName, \u0027, \u0027) LIKE \u0027%View Only Properties%\u0027 THEN \u002700000000-0000-0000-0000-000000000002\u0027\r\n\t \r\n END AS UserType\r\nFROM Users u\r\nLEFT JOIN (\r\n SELECT \r\n ur.UserId,\r\n MAX(ur.CreatedOn) AS CreatedOn,\r\n STRING_AGG(r.Name, \u0027, \u0027) AS RoleName\r\n FROM [pims].[dbo].[UserRoles] ur\r\n INNER JOIN Roles r ON ur.RoleId \u003d r.Id\r\n GROUP BY ur.UserId\r\n) AS urd ON u.Id \u003d urd.UserId\r\n\r\nLEFT OUTER JOIN (\r\n SELECT UserId, MIN(AgencyId) AS AgencyId\r\n FROM UserAgencies\r\n GROUP BY UserId\r\n) ua_min ON u.Id \u003d ua_min.UserId\r\nLEFT OUTER JOIN UserAgencies ua ON u.Id \u003d ua.UserId AND ua.AgencyId \u003d ua_min.AgencyId\r\n\r\nWHERE u.Id \u003c\u003e \u002700000000-0000-0000-0000-000000000000\u0027\r\n\r\nGROUP BY u.[Id],\r\n u.[CreatedById],\r\n u.[UpdatedById],\r\n u.[UpdatedOn],\r\n u.[Username],\r\n u.[DisplayName],\r\n u.[FirstName],\r\n u.[MiddleName],\r\n u.[LastName],\r\n u.[Email],\r\n u.[Position],\r\n u.[IsDisabled],\r\n u.[EmailVerified],\r\n u.[Note],\r\n u.[IsSystem],\r\n u.[LastLogin],\r\n u.[ApprovedById],\r\n u.[ApprovedOn],\r\n u.[KeycloakUserId],\r\n urd.CreatedOn, \r\n urd.UserId, \r\n ua.AgencyId\r\nORDER BY urd.CreatedOn ASC": { + "targetName": "user", "mappingType": "existing", "attributes": { - "parcelid": { - "targetName": "\"ParcelId\"", - "mappingType": "existing" - }, - "Date": { - "targetName": "\"Date\"", - "mappingType": "existing" - }, - "Key": { - "targetName": "\"EvaluationKeyId\"", + "id": { + "targetName": "id", "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, - "createdon": { - "targetName": "\"CreatedOn\"", + "status": { + "targetName": "status", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", - "mappingType": "existing" - }, - "firm": { - "targetName": "\"Firm\"", + "targetName": "updated_on", "mappingType": "existing" }, - "value": { - "targetName": "\"Value\"", + "username": { + "targetName": "username", "mappingType": "existing" }, - "note": { - "targetName": "\"Note\"", - "mappingType": "existing" - } - } - }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [ParcelId]\r\n ,[FiscalYear]\r\n ,[Key]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[Value]\r\n ,[Note]\r\n ,[EffectiveDate]\r\n FROM [dbo].[ParcelFiscals]": { - "targetName": "parcel_fiscal", - "mappingType": "existing", - "attributes": { - "parcelid": { - "targetName": "parcelid", + "displayname": { + "targetName": "display_name", "mappingType": "existing" }, - "fiscalyear": { - "targetName": "fiscalyear", + "firstname": { + "targetName": "first_name", "mappingType": "existing" }, - "Key": { - "targetName": "\"FiscalKeyId\"", + "middlename": { + "targetName": "middle_name", "mappingType": "existing" }, - "createdbyid": { - "targetName": "createdbyid", + "lastname": { + "targetName": "last_name", "mappingType": "existing" }, - "createdon": { - "targetName": "createdon", + "email": { + "targetName": "email", "mappingType": "existing" }, - "updatedbyid": { - "targetName": "updatedbyid", + "Position": { + "targetName": "Position", "mappingType": "existing" }, - "updatedon": { - "targetName": "updatedon", + "isdisabled": { + "targetName": "is_disabled", "mappingType": "existing" }, - "value": { - "targetName": "value", + "emailverified": { + "targetName": "email_verified", "mappingType": "existing" }, "note": { "targetName": "note", "mappingType": "existing" }, - "effectivedate": { - "targetName": "effectivedate", - "mappingType": "existing" - } - } - }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\n SELECT BuildingId,\r\n FiscalYear,\r\n [Key],\r\n CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById],\r\n CreatedOn,\r\n UpdatedById,\r\n UpdatedOn,\r\n [Value],\r\n Note,\r\n EffectiveDate\r\n FROM BuildingFiscals \r\n \r\nWHERE BuildingId IN (\r\n\tSELECT b.Id \r\n\tFROM Buildings b\r\n\tWHERE b.BuildingPredominateUseId \u003c\u003d 54\r\n)": { - "targetName": "building_fiscal", - "mappingType": "existing", - "attributes": { - "buildingid": { - "targetName": "\"BuildingId\"", + "issystem": { + "targetName": "is_system", "mappingType": "existing" }, - "fiscalyear": { - "targetName": "\"FiscalYear\"", + "lastlogin": { + "targetName": "last_login", "mappingType": "existing" }, - "Key": { - "targetName": "\"FiscalKeyId\"", + "approvedbyid": { + "targetName": "approved_by_id", "mappingType": "existing" }, - "createdbyid": { - "targetName": "\"CreatedById\"", + "approvedon": { + "targetName": "approved_on", "mappingType": "existing" }, - "createdon": { - "targetName": "\"CreatedOn\"", + "keycloakuserid": { + "targetName": "keycloak_user_id", "mappingType": "existing" }, - "updatedbyid": { - "targetName": "\"UpdatedById\"", + "createdon": { + "targetName": "created_on", "mappingType": "existing" }, - "updatedon": { - "targetName": "\"UpdatedOn\"", - "mappingType": "existing" + "userid": { + "targetName": "userid", + "mappingType": "skip" }, - "value": { - "targetName": "\"Value\"", + "agencyid": { + "targetName": "agency_id", "mappingType": "existing" }, - "note": { - "targetName": "\"Note\"", - "mappingType": "existing" + "roles": { + "targetName": "roles", + "mappingType": "skip" }, - "effectivedate": { - "targetName": "\"EffectiveDate\"", + "usertype": { + "targetName": "role_id", "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [BuildingId]\r\n ,[Date]\r\n ,[Key]\r\n ,\r\n\t CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[Value]\r\n ,[Note]\r\n FROM [pims].[dbo].[BuildingEvaluations]\r\nWHERE BuildingId IN (\r\n\tSELECT b.Id \r\n\tFROM Buildings b\r\n\tWHERE b.BuildingPredominateUseId \u003c\u003d 54\r\n)": { - "targetName": "building_evaluation", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT p.[Id],\r\n\t CASE \r\n\t\tWHEN p.[CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE p.[CreatedById]\r\n\t END AS [CreatedById],\r\n p.[CreatedOn],\r\n p.[UpdatedById],\r\n p.[UpdatedOn],\r\n p.[Name],\r\n p.[Description],\r\n p.[ClassificationId],\r\n p.[AgencyId],\r\n p.[IsSensitive],\r\n p.[IsVisibleToOtherAgencies],\r\n p.[PID],\r\n p.[PIN],\r\n p.[LandArea],\r\n p.[LandLegalDescription],\r\n p.[Zoning],\r\n p.[ZoningPotential],\r\n p.[NotOwned],\r\n\tCONVERT(VARCHAR(40), CAST(Location.Long AS DECIMAL(18, 14))) + \u0027, \u0027 + CONVERT(VARCHAR(40), CAST(Location.Lat AS DECIMAL(18, 14))) AS Location,\r\n CASE \r\n WHEN a.AdministrativeArea \u003d \u0027The Corporation of the City of Nelson\u0027 THEN 188\r\n WHEN a.AdministrativeArea \u003d \u0027Township of Langley\u0027 THEN 150\r\n WHEN a.AdministrativeArea \u003d \u0027District of North Vancouver\u0027 THEN 196\r\n WHEN a.AdministrativeArea \u003d \u0027Coombs\u0027 THEN 483\r\n WHEN a.AdministrativeArea \u003d \u0027Brookmere\u0027 THEN 481\r\n WHEN a.AdministrativeArea \u003d \u0027Thornhill\u0027 THEN 501\r\n WHEN a.AdministrativeArea \u003d \u0027Two Mile\u0027 THEN 502\r\n WHEN a.AdministrativeArea \u003d \u0027Crofton\u0027 THEN 484\r\n WHEN a.AdministrativeArea \u003d \u0027East Sooke\u0027 THEN 485\r\n WHEN a.AdministrativeArea \u003d \u0027Mudge Island\u0027 THEN 492\r\n WHEN a.AdministrativeArea \u003d \u0027Coal Harbour\u0027 THEN 482\r\n WHEN a.AdministrativeArea \u003d \u0027Miworth\u0027 THEN 490\r\n WHEN a.AdministrativeArea \u003d \u0027Lake Errock\u0027 THEN 489\r\n WHEN a.AdministrativeArea \u003d \u0027Black Creek\u0027 THEN 479\r\n WHEN a.AdministrativeArea \u003d \u0027Whaletown\u0027 THEN 504\r\n WHEN a.AdministrativeArea \u003d \u0027Quathiaski Cove\u0027 THEN 494\r\n WHEN a.AdministrativeArea \u003d \u0027Big Bay in Stuart Island\u0027 THEN 478\r\n WHEN a.AdministrativeArea \u003d \u0027Surge Narrows in Read Island\u0027 THEN 500\r\n WHEN a.AdministrativeArea \u003d \u0027Rock Bay in Sayward\u0027 THEN 497\r\n WHEN a.AdministrativeArea \u003d \u0027Granite Bay in Quadra Island\u0027 THEN 487\r\n WHEN a.AdministrativeArea \u003d \u0027Moberly Lake\u0027 THEN 491\r\n WHEN a.AdministrativeArea \u003d \u0027Quatsino\u0027 THEN 495\r\n WHEN a.AdministrativeArea \u003d \u0027Bouchie Lake\u0027 THEN 480\r\n WHEN a.AdministrativeArea \u003d \u0027West Lake\u0027 THEN 503\r\n WHEN a.AdministrativeArea \u003d \u0027Salmon Valley\u0027 THEN 498\t\t\r\n WHEN a.AdministrativeArea \u003d \u0027Red Rock\u0027 THEN 496\r\n WHEN a.AdministrativeArea \u003d \u0027Stoner\u0027 THEN 499\r\n WHEN a.AdministrativeArea \u003d \u0027Pineview FFG\u0027 THEN 493\r\n WHEN a.AdministrativeArea \u003d \u0027Wonowon\u0027 THEN 506\r\n WHEN a.AdministrativeArea \u003d \u0027Halfway River\u0027 THEN 488\r\n WHEN a.AdministrativeArea \u003d \u0027Giscome\u0027 THEN 486\r\n WHEN a.AdministrativeArea \u003d \u0027Willow River\u0027 THEN 505\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Lower Nicola\u0027 THEN 314\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Belcarra\u0027 THEN 425\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Tsawwassen\u0027 THEN 315\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Anmore\u0027 THEN 432\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Lake Cowichan\u0027 THEN 442\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027North Cowichan\u0027 THEN 450\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Port Edward\u0027 THEN 347\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Spallumcheen\u0027 THEN 318\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Jumbo Glacier Mountain Resort Municipality\u0027 THEN 438\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Kent\u0027 THEN 439\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Highlands\u0027 THEN 348\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Slocan\u0027 THEN 380\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Warfield\u0027 THEN 448\r\n ELSE aa.Id \r\n END AS AdministrativeAreaId, \r\n\ta.AdministrativeArea,\r\n\ta.Address1, \r\n\ta.Postal,\r\n\tpp.ParcelId as ParentID,\r\n\t0 as PropertyTypeID\r\nFROM \r\n [pims].[dbo].[Parcels] p\r\n\tINNER JOIN Addresses a\r\n\tON p.AddressId \u003d a.Id\r\n\tLEFT OUTER JOIN AdministrativeAreas aa\r\n\tON aa.Name \u003d a.AdministrativeArea\r\n    LEFT OUTER JOIN ParcelParcels pp\r\n    ON pp.SubdivisionId \u003d p.Id": { + "targetName": "parcel", "mappingType": "existing", "attributes": { - "buildingid": { - "targetName": "\"BuildingId\"", - "mappingType": "existing" - }, - "Date": { - "targetName": "\"Date\"", - "mappingType": "existing" - }, - "Key": { - "targetName": "\"EvaluationKeyId\"", + "id": { + "targetName": "\"Id\"", "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", + "targetName": "updated_on", "mappingType": "existing" }, - "value": { - "targetName": "\"Value\"", + "Name": { + "targetName": "\"Name\"", "mappingType": "existing" }, - "note": { - "targetName": "\"Note\"", + "description": { + "targetName": "\"Description\"", "mappingType": "existing" - } - } - }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/Projects": { - "targetName": "project", - "mappingType": "existing", - "attributes": { - "id": { - "targetName": "\"Id\"", + }, + "classificationid": { + "targetName": "classification_id", "mappingType": "existing" }, - "createdbyid": { - "targetName": "\"CreatedById\"", + "agencyid": { + "targetName": "agency_id", "mappingType": "existing" }, - "createdon": { - "targetName": "\"CreatedOn\"", + "issensitive": { + "targetName": "is_sensitive", "mappingType": "existing" }, - "updatedbyid": { - "targetName": "\"UpdatedById\"", + "isvisibletootheragencies": { + "targetName": "is_visible_to_other_agencies", "mappingType": "existing" }, - "updatedon": { - "targetName": "\"UpdatedOn\"", + "pid": { + "targetName": "\"PID\"", "mappingType": "existing" }, - "rowversion": { - "targetName": "\"RowVersion\"", - "mappingType": "skip" + "pin": { + "targetName": "\"PIN\"", + "mappingType": "existing" }, - "projectnumber": { - "targetName": "\"ProjectNumber\"", + "landarea": { + "targetName": "land_area", "mappingType": "existing" }, - "Name": { - "targetName": "\"Name\"", + "landlegaldescription": { + "targetName": "land_legal_description", "mappingType": "existing" }, - "workflowid": { - "targetName": "\"WorkflowId\"", + "zoning": { + "targetName": "\"Zoning\"", "mappingType": "existing" }, - "manager": { - "targetName": "\"Manager\"", + "zoningpotential": { + "targetName": "zoning_potential", "mappingType": "existing" }, - "reportedfiscalyear": { - "targetName": "\"ReportedFiscalYear\"", + "notowned": { + "targetName": "not_owned", "mappingType": "existing" }, - "actualfiscalyear": { - "targetName": "\"ActualFiscalYear\"", + "Location": { + "targetName": "\"Location\"", "mappingType": "existing" }, - "agencyid": { - "targetName": "\"AgencyId\"", + "administrativeareaid": { + "targetName": "administrative_area_id", "mappingType": "existing" }, - "statusid": { - "targetName": "\"StatusId\"", + "administrativearea": { + "targetName": "\"AdministrativeArea\"", + "mappingType": "skip" + }, + "address1": { + "targetName": "\"Address1\"", "mappingType": "existing" }, - "description": { - "targetName": "\"Description\"", + "postal": { + "targetName": "\"Postal\"", "mappingType": "existing" }, - "tierlevelid": { - "targetName": "\"TierLevelId\"", + "parentid": { + "targetName": "parent_parcel_id", "mappingType": "existing" }, - "riskid": { - "targetName": "\"RiskId\"", + "propertytypeid": { + "targetName": "property_type_id", + "mappingType": "existing" + } + } + }, + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT p.[Id],\r\n\tCASE \r\n\t WHEN p.[CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t ELSE p.[CreatedById]\r\n\tEND AS [CreatedById],\r\n p.[CreatedOn],\r\n p.[UpdatedById],\r\n p.[UpdatedOn],\r\n p.[Name],\r\n p.[Description],\r\n p.[ClassificationId],\r\n p.BuildingConstructionTypeId,\r\n p.[AgencyId],\r\n p.[IsSensitive],\r\n p.[IsVisibleToOtherAgencies],\r\n\tp.BuildingFloorCount,\r\n\tp.BuildingPredominateUseId,\r\n\tp.BuildingTenancy,\r\n\tp.RentableArea,\r\n\tp.BuildingOccupantTypeId,\r\n\tp.LeaseExpiry,\r\n\tp.OccupantName,\r\n\tp.TransferLeaseOnSale,\r\n\tp.BuildingTenancyUpdatedOn,\r\n\tp.EncumbranceReason,\r\n\tp.LeasedLandMetadata,\r\n\tp.TotalArea,\r\n\tCONVERT(VARCHAR(40), CAST(Location.Long AS DECIMAL(18, 14))) + \u0027, \u0027 + CONVERT(VARCHAR(40), CAST(Location.Lat AS DECIMAL(18, 14))) AS Location,\r\n\tCASE \r\n WHEN a.AdministrativeArea \u003d \u0027The Corporation of the City of Nelson\u0027 THEN 188\r\n WHEN a.AdministrativeArea \u003d \u0027Township of Langley\u0027 THEN 150\r\n WHEN a.AdministrativeArea \u003d \u0027District of North Vancouver\u0027 THEN 196\r\n WHEN a.AdministrativeArea \u003d \u0027Coombs\u0027 THEN 483\r\n WHEN a.AdministrativeArea \u003d \u0027Brookmere\u0027 THEN 481\r\n WHEN a.AdministrativeArea \u003d \u0027Thornhill\u0027 THEN 501\r\n WHEN a.AdministrativeArea \u003d \u0027Two Mile\u0027 THEN 502\r\n WHEN a.AdministrativeArea \u003d \u0027Crofton\u0027 THEN 484\r\n WHEN a.AdministrativeArea \u003d \u0027East Sooke\u0027 THEN 485\r\n WHEN a.AdministrativeArea \u003d \u0027Mudge Island\u0027 THEN 492\r\n WHEN a.AdministrativeArea \u003d \u0027Coal Harbour\u0027 THEN 482\r\n WHEN a.AdministrativeArea \u003d \u0027Miworth\u0027 THEN 490\r\n WHEN a.AdministrativeArea \u003d \u0027Lake Errock\u0027 THEN 489\r\n WHEN a.AdministrativeArea \u003d \u0027Black Creek\u0027 THEN 479\r\n WHEN a.AdministrativeArea \u003d \u0027Whaletown\u0027 THEN 504\r\n WHEN a.AdministrativeArea \u003d \u0027Quathiaski Cove\u0027 THEN 494\r\n WHEN a.AdministrativeArea \u003d \u0027Big Bay in Stuart Island\u0027 THEN 478\r\n WHEN a.AdministrativeArea \u003d \u0027Surge Narrows in Read Island\u0027 THEN 500\r\n WHEN a.AdministrativeArea \u003d \u0027Rock Bay in Sayward\u0027 THEN 497\r\n WHEN a.AdministrativeArea \u003d \u0027Granite Bay in Quadra Island\u0027 THEN 487\r\n WHEN a.AdministrativeArea \u003d \u0027Moberly Lake\u0027 THEN 491\r\n WHEN a.AdministrativeArea \u003d \u0027Quatsino\u0027 THEN 495\r\n WHEN a.AdministrativeArea \u003d \u0027Bouchie Lake\u0027 THEN 480\r\n WHEN a.AdministrativeArea \u003d \u0027West Lake\u0027 THEN 503\r\n WHEN a.AdministrativeArea \u003d \u0027Salmon Valley\u0027 THEN 498\t\t\r\n WHEN a.AdministrativeArea \u003d \u0027Red Rock\u0027 THEN 496\r\n WHEN a.AdministrativeArea \u003d \u0027Stoner\u0027 THEN 499\r\n WHEN a.AdministrativeArea \u003d \u0027Pineview FFG\u0027 THEN 493\r\n WHEN a.AdministrativeArea \u003d \u0027Wonowon\u0027 THEN 506\r\n WHEN a.AdministrativeArea \u003d \u0027Halfway River\u0027 THEN 488\r\n WHEN a.AdministrativeArea \u003d \u0027Giscome\u0027 THEN 486\r\n WHEN a.AdministrativeArea \u003d \u0027Willow River\u0027 THEN 505\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Lower Nicola\u0027 THEN 314\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Belcarra\u0027 THEN 425\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Tsawwassen\u0027 THEN 315\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Anmore\u0027 THEN 432\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Lake Cowichan\u0027 THEN 442\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027North Cowichan\u0027 THEN 450\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Port Edward\u0027 THEN 347\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Spallumcheen\u0027 THEN 318\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Jumbo Glacier Mountain Resort Municipality\u0027 THEN 438\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Kent\u0027 THEN 439\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Highlands\u0027 THEN 348\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Slocan\u0027 THEN 380\r\n\t\tWHEN a.AdministrativeArea \u003d \u0027Warfield\u0027 THEN 448\r\n ELSE aa.Id \r\n END AS AdministrativeAreaId, \r\n\ta.Address1, \r\n\ta.Postal,\r\n\t1 as PropertyTypeID\r\nFROM \r\n [pims].[dbo].Buildings p\r\n\tINNER JOIN Addresses a\r\n\tON p.AddressId \u003d a.Id\r\n\tLEFT OUTER JOIN AdministrativeAreas aa\r\n\tON aa.Name \u003d a.AdministrativeArea\r\nWHERE p.BuildingPredominateUseId \u003c\u003d 54": { + "targetName": "building", + "mappingType": "existing", + "attributes": { + "id": { + "targetName": "\"Id\"", "mappingType": "existing" }, - "metadata": { - "targetName": "\"Metadata\"", + "createdbyid": { + "targetName": "created_by_id", "mappingType": "existing" }, - "submittedon": { - "targetName": "\"SubmittedOn\"", + "createdon": { + "targetName": "created_on", "mappingType": "existing" }, - "approvedon": { - "targetName": "\"ApprovedOn\"", + "updatedbyid": { + "targetName": "updated_by_id", "mappingType": "existing" }, - "deniedon": { - "targetName": "\"DeniedOn\"", + "updatedon": { + "targetName": "updated_on", "mappingType": "existing" }, - "cancelledon": { - "targetName": "\"CancelledOn\"", + "Name": { + "targetName": "\"Name\"", "mappingType": "existing" }, - "completedon": { - "targetName": "\"CompletedOn\"", + "description": { + "targetName": "\"Description\"", "mappingType": "existing" }, - "netbook": { - "targetName": "\"NetBook\"", + "classificationid": { + "targetName": "classification_id", "mappingType": "existing" }, - "market": { - "targetName": "\"Market\"", + "buildingconstructiontypeid": { + "targetName": "building_construction_type_id", "mappingType": "existing" }, - "assessed": { - "targetName": "\"Assessed\"", + "agencyid": { + "targetName": "agency_id", "mappingType": "existing" }, - "appraised": { - "targetName": "\"Appraised\"", + "issensitive": { + "targetName": "is_sensitive", "mappingType": "existing" }, - "projecttype": { - "targetName": "\"ProjectType\"", + "isvisibletootheragencies": { + "targetName": "is_visible_to_other_agencies", "mappingType": "existing" - } - } - }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT [ProjectId]\r\n ,[TaskId]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[IsCompleted]\r\n ,[CompletedOn]\r\n FROM [dbo].[ProjectTasks]": { - "targetName": "project_task", - "mappingType": "existing", - "attributes": { - "projectid": { - "targetName": "\"ProjectId\"", + }, + "buildingfloorcount": { + "targetName": "building_floor_count", "mappingType": "existing" }, - "taskid": { - "targetName": "\"TaskId\"", + "buildingpredominateuseid": { + "targetName": "building_predominate_use_id", "mappingType": "existing" }, - "CreatedById\r\n ,[CreatedOn": { - "targetName": "\"CreatedById\"", + "buildingtenancy": { + "targetName": "building_tenancy", "mappingType": "existing" }, - "updatedbyid": { - "targetName": "\"UpdatedById\"", + "rentablearea": { + "targetName": "rentable_area", "mappingType": "existing" }, - "updatedon": { - "targetName": "\"UpdatedOn\"", + "buildingoccupanttypeid": { + "targetName": "building_occupant_type_id", "mappingType": "existing" }, - "iscompleted": { - "targetName": "\"IsCompleted\"", + "leaseexpiry": { + "targetName": "lease_expiry", "mappingType": "existing" }, - "completedon": { - "targetName": "\"CompletedOn\"", + "occupantname": { + "targetName": "occupant_name", "mappingType": "existing" - } - } - }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [Id]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[IsFinal]\r\n ,[Name]\r\n ,[From]\r\n ,[To]\r\n ,[ReportType]\r\n FROM [dbo].[ProjectReports]": { - "targetName": "project_report", - "mappingType": "existing", - "attributes": { - "id": { - "targetName": "\"Id\"", + }, + "transferleaseonsale": { + "targetName": "transfer_lease_on_sale", "mappingType": "existing" }, - "createdbyid": { - "targetName": "\"CreatedById\"", + "buildingtenancyupdatedon": { + "targetName": "building_tenancy_updated_on", "mappingType": "existing" }, - "createdon": { - "targetName": "\"CreatedOn\"", + "encumbrancereason": { + "targetName": "encumbrance_reason", "mappingType": "existing" }, - "updatedbyid": { - "targetName": "\"UpdatedById\"", + "leasedlandmetadata": { + "targetName": "leased_land_metadata", "mappingType": "existing" }, - "updatedon": { - "targetName": "\"UpdatedOn\"", + "totalarea": { + "targetName": "total_area", "mappingType": "existing" }, - "isfinal": { - "targetName": "\"IsFinal\"", + "Location": { + "targetName": "\"location\"", "mappingType": "existing" }, - "Name": { - "targetName": "\"Name\"", + "administrativeareaid": { + "targetName": "administrative_area_id", "mappingType": "existing" }, - "From": { - "targetName": "\"From\"", + "address1": { + "targetName": "\"Address1\"", "mappingType": "existing" }, - "To": { - "targetName": "\"To\"", + "postal": { + "targetName": "\"Postal\"", "mappingType": "existing" }, - "reporttype": { - "targetName": "\"ReportTypeId\"", + "propertytypeid": { + "targetName": "property_type_id", "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectSnapshots": { - "targetName": "project_snapshot", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT pb.*\r\n FROM [pims].[dbo].ParcelBuildings pb\r\n INNER JOIN Buildings b\r\n ON b.Id \u003d pb.BuildingId\r\n WHERE b.BuildingPredominateUseId \u003c\u003d 54": { + "targetName": "parcel_building", "mappingType": "existing", "attributes": { - "id": { - "targetName": "\"Id\"", + "parcelid": { + "targetName": "parcel_id", + "mappingType": "existing" + }, + "buildingid": { + "targetName": "building_id", "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", + "targetName": "updated_on", "mappingType": "existing" }, "rowversion": { "targetName": "\"RowVersion\"", "mappingType": "skip" + } + } + }, + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [ParcelId]\r\n ,[Date]\r\n ,[Key]\r\n ,\r\n\t CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[Firm]\r\n ,[Value]\r\n ,[Note]\r\n FROM [pims].[dbo].[ParcelEvaluations]": { + "targetName": "parcel_evaluation", + "mappingType": "existing", + "attributes": { + "parcelid": { + "targetName": "parcel_id", + "mappingType": "existing" }, - "projectid": { - "targetName": "\"ProjectId\"", + "Date": { + "targetName": "date", "mappingType": "existing" }, - "netbook": { - "targetName": "\"NetBook\"", + "Key": { + "targetName": "evaluation_key_id", "mappingType": "existing" }, - "market": { - "targetName": "\"Market\"", + "createdbyid": { + "targetName": "created_by_id", "mappingType": "existing" }, - "assessed": { - "targetName": "\"Assessed\"", + "createdon": { + "targetName": "created_on", "mappingType": "existing" }, - "appraised": { - "targetName": "\"Appraised\"", + "updatedbyid": { + "targetName": "updated_by_id", "mappingType": "existing" }, - "snapshoton": { - "targetName": "\"SnapshotOn\"", + "updatedon": { + "targetName": "updated_on", "mappingType": "existing" }, - "metadata": { - "targetName": "\"Metadata\"", + "firm": { + "targetName": "\"Firm\"", + "mappingType": "existing" + }, + "value": { + "targetName": "\"Value\"", + "mappingType": "existing" + }, + "note": { + "targetName": "\"Note\"", "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectStatusHistory": { - "targetName": "project_status_history", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [ParcelId]\r\n ,[FiscalYear]\r\n ,[Key]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[Value]\r\n ,[Note]\r\n ,[EffectiveDate]\r\n FROM [dbo].[ParcelFiscals]": { + "targetName": "parcel_fiscal", "mappingType": "existing", "attributes": { - "id": { - "targetName": "\"Id\"", + "parcelid": { + "targetName": "parcel_id", + "mappingType": "existing" + }, + "fiscalyear": { + "targetName": "fiscal_year", + "mappingType": "existing" + }, + "Key": { + "targetName": "fiscal_key_id", "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", + "targetName": "updated_on", "mappingType": "existing" }, - "rowversion": { - "targetName": "\"RowVersion\"", - "mappingType": "skip" - }, - "projectid": { - "targetName": "\"ProjectId\"", + "value": { + "targetName": "value", "mappingType": "existing" }, - "workflowid": { - "targetName": "\"WorkflowId\"", + "note": { + "targetName": "note", "mappingType": "existing" }, - "statusid": { - "targetName": "\"StatusId\"", + "effectivedate": { + "targetName": "effective_date", "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectProperties": { - "targetName": "project_property", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\n SELECT BuildingId,\r\n FiscalYear,\r\n [Key],\r\n CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById],\r\n CreatedOn,\r\n UpdatedById,\r\n UpdatedOn,\r\n [Value],\r\n Note,\r\n EffectiveDate\r\n FROM BuildingFiscals \r\n \r\nWHERE BuildingId IN (\r\n\tSELECT b.Id \r\n\tFROM Buildings b\r\n\tWHERE b.BuildingPredominateUseId \u003c\u003d 54\r\n)": { + "targetName": "building_fiscal", "mappingType": "existing", "attributes": { - "id": { - "targetName": "\"Id\"", + "buildingid": { + "targetName": "building_id", + "mappingType": "existing" + }, + "fiscalyear": { + "targetName": "fiscal_year", + "mappingType": "existing" + }, + "Key": { + "targetName": "fiscal_key_id", "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", - "mappingType": "existing" - }, - "rowversion": { - "targetName": "\"RowVersion\"", - "mappingType": "skip" - }, - "projectid": { - "targetName": "\"ProjectId\"", + "targetName": "updated_on", "mappingType": "existing" }, - "propertytype": { - "targetName": "\"PropertyTypeId\"", + "value": { + "targetName": "\"Value\"", "mappingType": "existing" }, - "parcelid": { - "targetName": "\"ParcelId\"", + "note": { + "targetName": "\"Note\"", "mappingType": "existing" }, - "buildingid": { - "targetName": "\"BuildingId\"", + "effectivedate": { + "targetName": "effective_date", "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT [ProjectId]\r\n ,[AgencyId]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[OfferAmount]\r\n ,[NotificationId]\r\n ,[Response]\r\n ,[ReceivedOn]\r\n ,[Note]\r\n FROM [dbo].[ProjectAgencyResponses]": { - "targetName": "project_agency_response", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [BuildingId]\r\n ,[Date]\r\n ,[Key]\r\n ,\r\n\t CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[Value]\r\n ,[Note]\r\n FROM [pims].[dbo].[BuildingEvaluations]\r\nWHERE BuildingId IN (\r\n\tSELECT b.Id \r\n\tFROM Buildings b\r\n\tWHERE b.BuildingPredominateUseId \u003c\u003d 54\r\n)": { + "targetName": "building_evaluation", "mappingType": "existing", "attributes": { - "projectid": { - "targetName": "\"ProjectId\"", + "buildingid": { + "targetName": "building_id", "mappingType": "existing" }, - "agencyid": { - "targetName": "\"AgencyId\"", + "Date": { + "targetName": "\"Date\"", + "mappingType": "existing" + }, + "Key": { + "targetName": "evaluation_key_id", "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", - "mappingType": "existing" - }, - "offeramount": { - "targetName": "\"OfferAmount\"", - "mappingType": "existing" - }, - "notificationid": { - "targetName": "\"NotificationId\"", - "mappingType": "existing" - }, - "response": { - "targetName": "\"Response\"", + "targetName": "updated_on", "mappingType": "existing" }, - "receivedon": { - "targetName": "\"ReceivedOn\"", + "value": { + "targetName": "\"Value\"", "mappingType": "existing" }, "note": { @@ -1294,38 +1292,42 @@ } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/ProjectNumbers": { - "targetName": "project_number", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT [ProjectId]\r\n ,[TaskId]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[IsCompleted]\r\n ,[CompletedOn]\r\n FROM [dbo].[ProjectTasks]": { + "targetName": "project_task", "mappingType": "existing", "attributes": { - "id": { - "targetName": "\"Id\"", + "projectid": { + "targetName": "project_id", "mappingType": "existing" }, - "createdbyid": { - "targetName": "\"CreatedById\"", + "taskid": { + "targetName": "task_id", "mappingType": "existing" }, - "createdon": { - "targetName": "\"CreatedOn\"", + "CreatedById\r\n ,[CreatedOn": { + "targetName": "created_by_id", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", + "targetName": "updated_on", "mappingType": "existing" }, - "rowversion": { - "targetName": "\"RowVersion\"", - "mappingType": "skip" + "iscompleted": { + "targetName": "is_completed", + "mappingType": "existing" + }, + "completedon": { + "targetName": "completed_on", + "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [Id]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[ProjectId]\r\n ,[NoteType]\r\n ,[Note]\r\n FROM [dbo].[ProjectNotes]": { - "targetName": "project_note", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [Id]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[IsFinal]\r\n ,[Name]\r\n ,[From]\r\n ,[To]\r\n ,[ReportType]\r\n FROM [dbo].[ProjectReports]": { + "targetName": "project_report", "mappingType": "existing", "attributes": { "id": { @@ -1333,129 +1335,127 @@ "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", + "targetName": "updated_on", "mappingType": "existing" }, - "projectid": { - "targetName": "\"ProjectId\"", + "isfinal": { + "targetName": "is_final", "mappingType": "existing" }, - "notetype": { - "targetName": "\"NoteType\"", + "Name": { + "targetName": "\"Name\"", "mappingType": "existing" }, - "note": { - "targetName": "\"Note\"", + "From": { + "targetName": "\"From\"", + "mappingType": "existing" + }, + "To": { + "targetName": "\"To\"", + "mappingType": "existing" + }, + "reporttype": { + "targetName": "report_type_id", "mappingType": "existing" } } }, - "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/pims/dbo/NotificationQueue": { - "targetName": "notification_queue", + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/\r\nSELECT [ProjectId]\r\n ,[AgencyId]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[OfferAmount]\r\n ,[NotificationId]\r\n ,[Response]\r\n ,[ReceivedOn]\r\n ,[Note]\r\n FROM [dbo].[ProjectAgencyResponses]": { + "targetName": "project_agency_response", "mappingType": "existing", "attributes": { - "id": { - "targetName": "\"Id\"", + "projectid": { + "targetName": "project_id", + "mappingType": "existing" + }, + "agencyid": { + "targetName": "agency_id", "mappingType": "existing" }, "createdbyid": { - "targetName": "\"CreatedById\"", + "targetName": "created_by_id", "mappingType": "existing" }, "createdon": { - "targetName": "\"CreatedOn\"", + "targetName": "created_on", "mappingType": "existing" }, "updatedbyid": { - "targetName": "\"UpdatedById\"", + "targetName": "updated_by_id", "mappingType": "existing" }, "updatedon": { - "targetName": "\"UpdatedOn\"", - "mappingType": "existing" - }, - "rowversion": { - "targetName": "\"RowVersion\"", - "mappingType": "skip" - }, - "Key": { - "targetName": "\"Key\"", - "mappingType": "existing" - }, - "status": { - "targetName": "\"Status\"", + "targetName": "updated_on", "mappingType": "existing" }, - "priority": { - "targetName": "\"Priority\"", + "offeramount": { + "targetName": "offer_amount", "mappingType": "existing" }, - "Encoding": { - "targetName": "\"Encoding\"", + "notificationid": { + "targetName": "notification_id", "mappingType": "existing" }, - "sendon": { - "targetName": "\"SendOn\"", + "response": { + "targetName": "\"Response\"", "mappingType": "existing" }, - "To": { - "targetName": "\"To\"", + "receivedon": { + "targetName": "received_on", "mappingType": "existing" }, - "subject": { - "targetName": "\"Subject\"", + "note": { + "targetName": "\"Note\"", "mappingType": "existing" - }, - "bodytype": { - "targetName": "\"BodyType\"", + } + } + }, + "mssql_jtds_legacy-18ceb477545-3f1bdd7d812c2539/SELECT [Id]\r\n ,CASE \r\n\t\tWHEN [CreatedById] IS NULL THEN \u002700000000-0000-0000-0000-000000000000\u0027\r\n\t\tELSE [CreatedById]\r\n\t END AS [CreatedById]\r\n ,[CreatedOn]\r\n ,[UpdatedById]\r\n ,[UpdatedOn]\r\n ,[ProjectId]\r\n ,[NoteType]\r\n ,[Note]\r\n FROM [dbo].[ProjectNotes]": { + "targetName": "project_note", + "mappingType": "existing", + "attributes": { + "id": { + "targetName": "\"Id\"", "mappingType": "existing" }, - "body": { - "targetName": "\"Body\"", + "createdbyid": { + "targetName": "created_by_id", "mappingType": "existing" }, - "bcc": { - "targetName": "\"Bcc\"", + "createdon": { + "targetName": "created_on", "mappingType": "existing" }, - "cc": { - "targetName": "\"Cc\"", + "updatedbyid": { + "targetName": "updated_by_id", "mappingType": "existing" }, - "tag": { - "targetName": "\"Tag\"", + "updatedon": { + "targetName": "updated_on", "mappingType": "existing" }, "projectid": { - "targetName": "\"ProjectId\"", - "mappingType": "existing" - }, - "toagencyid": { - "targetName": "\"ToAgencyId\"", + "targetName": "project_id", "mappingType": "existing" }, - "templateid": { - "targetName": "\"TemplateId\"", - "mappingType": "existing" - }, - "chesmessageid": { - "targetName": "\"ChesMessageId\"", + "notetype": { + "targetName": "note_type", "mappingType": "existing" }, - "chestransactionid": { - "targetName": "\"ChesTransactionId\"", + "note": { + "targetName": "\"Note\"", "mappingType": "existing" } }