check related work order tables
parent
302875ee57
commit
c5c86b5964
|
|
@ -105,7 +105,8 @@ export const cleanupDatabase = (requestSession) => {
|
||||||
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyFees)" +
|
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyFees)" +
|
||||||
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyFields)" +
|
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyFields)" +
|
||||||
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyOccupants)" +
|
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyOccupants)" +
|
||||||
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyTransactions)")
|
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyTransactions)" +
|
||||||
|
" and lotOccupancyId not in (select lotOccupancyId from WorkOrderLotOccupancies)")
|
||||||
.run(recordDelete_timeMillisMin).changes;
|
.run(recordDelete_timeMillisMin).changes;
|
||||||
inactivedRecordCount += database
|
inactivedRecordCount += database
|
||||||
.prepare("update Fees" +
|
.prepare("update Fees" +
|
||||||
|
|
@ -173,7 +174,8 @@ export const cleanupDatabase = (requestSession) => {
|
||||||
.prepare("delete from Lots where recordDelete_timeMillis <= ?" +
|
.prepare("delete from Lots where recordDelete_timeMillis <= ?" +
|
||||||
" and lotId not in (select lotId from LotComments)" +
|
" and lotId not in (select lotId from LotComments)" +
|
||||||
" and lotId not in (select lotId from LotFields)" +
|
" and lotId not in (select lotId from LotFields)" +
|
||||||
" and lotId not in (select lotId from LotOccupancies)")
|
" and lotId not in (select lotId from LotOccupancies)" +
|
||||||
|
" and lotId not in (select lotId from WorkOrderLots)")
|
||||||
.run(recordDelete_timeMillisMin).changes;
|
.run(recordDelete_timeMillisMin).changes;
|
||||||
purgedRecordCount += database
|
purgedRecordCount += database
|
||||||
.prepare("delete from LotStatuses where recordDelete_timeMillis <= ?" +
|
.prepare("delete from LotStatuses where recordDelete_timeMillis <= ?" +
|
||||||
|
|
|
||||||
|
|
@ -179,7 +179,8 @@ export const cleanupDatabase = (requestSession: recordTypes.PartialSession) => {
|
||||||
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyFees)" +
|
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyFees)" +
|
||||||
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyFields)" +
|
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyFields)" +
|
||||||
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyOccupants)" +
|
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyOccupants)" +
|
||||||
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyTransactions)"
|
" and lotOccupancyId not in (select lotOccupancyId from LotOccupancyTransactions)" +
|
||||||
|
" and lotOccupancyId not in (select lotOccupancyId from WorkOrderLotOccupancies)"
|
||||||
)
|
)
|
||||||
.run(recordDelete_timeMillisMin).changes;
|
.run(recordDelete_timeMillisMin).changes;
|
||||||
|
|
||||||
|
|
@ -298,7 +299,8 @@ export const cleanupDatabase = (requestSession: recordTypes.PartialSession) => {
|
||||||
"delete from Lots where recordDelete_timeMillis <= ?" +
|
"delete from Lots where recordDelete_timeMillis <= ?" +
|
||||||
" and lotId not in (select lotId from LotComments)" +
|
" and lotId not in (select lotId from LotComments)" +
|
||||||
" and lotId not in (select lotId from LotFields)" +
|
" and lotId not in (select lotId from LotFields)" +
|
||||||
" and lotId not in (select lotId from LotOccupancies)"
|
" and lotId not in (select lotId from LotOccupancies)" +
|
||||||
|
" and lotId not in (select lotId from WorkOrderLots)"
|
||||||
)
|
)
|
||||||
.run(recordDelete_timeMillisMin).changes;
|
.run(recordDelete_timeMillisMin).changes;
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue