fix: show remoteGisCount (505) as cu geometrie, add no-geom cleanup step
- UI: scan card now shows remoteGisCount instead of matchedCount (withGeometry) as the primary 'cu geometrie' number — this is the true GIS layer feature count - UI: workflow preview step 1 shows remoteGisCount for download count - UI: mismatch note reworded as secondary detail about cross-reference matching - Import: automatic cleanup step at start of syncNoGeometryParcels - Builds valid immovablePk set from fresh list (active + identification/area) - Deletes stale NO_GEOMETRY records not in the valid set - Reports cleaned count in result + progress note - NoGeomSyncResult type: added 'cleaned' field - Gitignore: temp-db-check.cjs
This commit is contained in:
@@ -0,0 +1,36 @@
|
||||
const { PrismaClient } = require("@prisma/client");
|
||||
const p = new PrismaClient({
|
||||
datasourceUrl:
|
||||
"postgresql://architools_user:stictMyFon34!_gonY@10.10.10.166:5432/architools_db?schema=public",
|
||||
});
|
||||
|
||||
(async () => {
|
||||
const features = await p.$queryRawUnsafe(`
|
||||
SELECT "layerId", siruta, "geometrySource", COUNT(*)::int as nr
|
||||
FROM "GisFeature"
|
||||
GROUP BY "layerId", siruta, "geometrySource"
|
||||
ORDER BY "layerId", siruta, "geometrySource"
|
||||
`);
|
||||
console.log("=== GisFeature ===");
|
||||
console.table(features);
|
||||
|
||||
const syncs = await p.$queryRawUnsafe(`
|
||||
SELECT "layerId", siruta, status, COUNT(*)::int as nr
|
||||
FROM "GisSyncRun"
|
||||
GROUP BY "layerId", siruta, status
|
||||
ORDER BY "layerId", siruta
|
||||
`);
|
||||
console.log("=== GisSyncRun ===");
|
||||
console.table(syncs);
|
||||
|
||||
const uats = await p.$queryRawUnsafe(`
|
||||
SELECT siruta, name, county, "workspacePk"
|
||||
FROM "GisUat"
|
||||
WHERE "workspacePk" IS NOT NULL AND "workspacePk" > 0
|
||||
LIMIT 20
|
||||
`);
|
||||
console.log("=== GisUat (with workspacePk) ===");
|
||||
console.table(uats);
|
||||
|
||||
await p.$disconnect();
|
||||
})();
|
||||
Reference in New Issue
Block a user