fix according to move to postgres
This commit is contained in:
parent
f11ed83afc
commit
aeb1ccbc42
1 changed files with 1 additions and 4 deletions
|
@ -1,7 +1,6 @@
|
|||
import { Like, In } from "typeorm";
|
||||
import { dataSource } from "../../../data-source";
|
||||
import { inspectionPlan } from "../../../entity/unit/inspection/inspectionPlan";
|
||||
import { DB_TYPE } from "../../../env.defaults";
|
||||
import DatabaseActionException from "../../../exceptions/databaseActionException";
|
||||
|
||||
export default abstract class InspectionPlanService {
|
||||
|
@ -13,9 +12,7 @@ export default abstract class InspectionPlanService {
|
|||
"inspectionPlan.latestVersionedPlan",
|
||||
"inspectionPlan.versionedPlans",
|
||||
"latestVersionedPlan",
|
||||
DB_TYPE == "postgres"
|
||||
? 'latestVersionedPlan.inspectionPlanId = inspectionPlan.id AND latestVersionedPlan.version = (SELECT MAX("ivp"."createdAt") FROM "inspection_versioned_plan" "ivp" WHERE "ivp"."inspectionPlanId" = "inspectionPlan"."id")'
|
||||
: "latestVersionedPlan.inspectionPlanId = inspectionPlan.id AND latestVersionedPlan.version = (SELECT MAX(ivp.createdAt) FROM inspection_versioned_plan ivp WHERE ivp.inspectionPlanId = inspectionPlan.id)"
|
||||
'latestVersionedPlan.inspectionPlanId = inspectionPlan.id AND latestVersionedPlan.version = (SELECT MAX("ivp"."createdAt") FROM "inspection_versioned_plan" "ivp" WHERE "ivp"."inspectionPlanId" = "inspectionPlan"."id")'
|
||||
)
|
||||
.leftJoinAndSelect("latestVersionedPlan.inspectionPoints", "inspectionPoints")
|
||||
.leftJoinAndSelect("inspectionPlan.equipmentType", "equipmentType")
|
||||
|
|
Loading…
Add table
Reference in a new issue