{"version":3,"file":"control.mjs","names":[],"sources":["../../../../3-extensions/postgis/dist/control.mjs"],"sourcesContent":["import { t as POSTGIS_GEOMETRY_CODEC_ID } from \"./constants-CWW72xGt.mjs\";\nimport { n as postgisQueryOperations, t as postgisPackMeta } from \"./descriptor-meta-deM0Qc_b.mjs\";\nimport { contractSpaceFromJson } from \"@internal/migration-tools/spaces\";\n//#region migrations/20260601T0000_install_postgis_extension/migration.json\nvar migration_default = {\n\tfrom: null,\n\tto: \"7e98a4d9437e6be2f2fa7fca02fbc01c245586997a937f97cab60788612512e5\",\n\tprovidedInvariants: [\"postgis:install-postgis-v1\"],\n\tcreatedAt: \"2026-06-01T00:00:00.000Z\",\n\tmigrationHash: \"f91b562a2f1a82f299a3690c001027729607c631c9b2d847aa3f6162539f0eff\"\n};\n//#endregion\n//#region migrations/20260601T0000_install_postgis_extension/ops.json\nvar ops_default = [{\n\t\"id\": \"postgis.install-postgis-extension\",\n\t\"label\": \"Enable extension \\\"postgis\\\"\",\n\t\"operationClass\": \"additive\",\n\t\"invariantId\": \"postgis:install-postgis-v1\",\n\t\"target\": {\n\t\t\"id\": \"postgres\",\n\t\t\"details\": {\n\t\t\t\"schema\": \"public\",\n\t\t\t\"objectType\": \"dependency\",\n\t\t\t\"name\": \"postgis\"\n\t\t}\n\t},\n\t\"precheck\": [{\n\t\t\"description\": \"verify extension \\\"postgis\\\" is not already enabled\",\n\t\t\"sql\": \"SELECT NOT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"postgis\"]\n\t}],\n\t\"execute\": [{\n\t\t\"description\": \"create extension \\\"postgis\\\"\",\n\t\t\"sql\": \"CREATE EXTENSION IF NOT EXISTS postgis\"\n\t}],\n\t\"postcheck\": [{\n\t\t\"description\": \"confirm extension \\\"postgis\\\" is enabled\",\n\t\t\"sql\": \"SELECT EXISTS (SELECT 1 AS \\\"one\\\" FROM \\\"pg_extension\\\" WHERE \\\"extname\\\" = $1) AS \\\"result\\\"\",\n\t\t\"params\": [\"postgis\"]\n\t}]\n}];\n//#endregion\n//#region migrations/refs/head.json\nvar head_default = {\n\thash: \"7e98a4d9437e6be2f2fa7fca02fbc01c245586997a937f97cab60788612512e5\",\n\tinvariants: [\"postgis:install-postgis-v1\"]\n};\n//#endregion\n//#region src/contract.json\nvar contract_default = {\n\tschemaVersion: \"1\",\n\ttargetFamily: \"sql\",\n\ttarget: \"postgres\",\n\tprofileHash: \"3916f444a8a17ad749191acf9e08dad97d1a327b88c2f1d45d12f240296aa8b2\",\n\troots: {},\n\tdomain: { \"namespaces\": { \"public\": { \"models\": {} } } },\n\tstorage: {\n\t\t\"namespaces\": { \"public\": {\n\t\t\t\"entries\": { \"table\": {} },\n\t\t\t\"id\": \"public\",\n\t\t\t\"kind\": \"postgres-schema\"\n\t\t} },\n\t\t\"storageHash\": \"7e98a4d9437e6be2f2fa7fca02fbc01c245586997a937f97cab60788612512e5\",\n\t\t\"types\": { \"geometry\": {\n\t\t\t\"codecId\": \"pg/geometry@1\",\n\t\t\t\"kind\": \"codec-instance\",\n\t\t\t\"nativeType\": \"geometry\"\n\t\t} }\n\t},\n\tcapabilities: {\n\t\t\"postgres\": {\n\t\t\t\"distinctOn\": true,\n\t\t\t\"jsonAgg\": true,\n\t\t\t\"lateral\": true,\n\t\t\t\"limit\": true,\n\t\t\t\"orderBy\": true,\n\t\t\t\"returning\": true\n\t\t},\n\t\t\"sql\": {\n\t\t\t\"checkConstraint\": true,\n\t\t\t\"defaultInInsert\": true,\n\t\t\t\"enums\": true,\n\t\t\t\"lateral\": true,\n\t\t\t\"returning\": true,\n\t\t\t\"scalarList\": true\n\t\t}\n\t},\n\textensions: {},\n\tmeta: {},\n\t_generated: {\n\t\t\"warning\": \"⚠️  GENERATED FILE - DO NOT EDIT\",\n\t\t\"message\": \"This file is automatically generated by \\\"prisma contract emit\\\".\",\n\t\t\"regenerate\": \"To regenerate, run: prisma contract emit\"\n\t}\n};\n//#endregion\n//#region src/core/contract-space-constants.ts\n/**\n* Static names and identifiers used across postgis's contract space.\n*\n* Centralised here so the contract IR (`./contract`), the baseline\n* migration ops (`./migrations`), the head ref, and the descriptor\n* (`../exports/control`) all reference the same values without typos.\n*\n* The space identifier `'postgis'` is what the framework writes to\n* `migrations/` in the user's repo and what the marker table's\n* `space` column carries for postgis-owned rows.\n*\n* The `postgis:*` invariantId namespace is locked here — once\n* published, an invariantId is immutable so downstream consumers can\n* reference it by literal string match.\n*/\nconst POSTGIS_SPACE_ID = \"postgis\";\nconst POSTGIS_BASELINE_MIGRATION_NAME = \"20260601T0000_install_postgis_extension\";\n//#endregion\n//#region src/exports/control.ts\nconst geometryControlPlaneHooks = {\n\texpandNativeType: ({ nativeType, typeParams }) => {\n\t\tconst srid = typeParams?.[\"srid\"];\n\t\tif (typeof srid === \"number\" && Number.isInteger(srid) && srid >= 0) return `${nativeType}(Geometry,${srid})`;\n\t\treturn nativeType;\n\t},\n\tresolveIdentityValue: () => null\n};\nconst postgisContractSpace = contractSpaceFromJson({\n\tcontractJson: contract_default,\n\tmigrations: [{\n\t\tdirName: POSTGIS_BASELINE_MIGRATION_NAME,\n\t\tmetadata: migration_default,\n\t\tops: ops_default\n\t}],\n\theadRef: head_default\n});\nconst postgisExtensionDescriptor = {\n\t...postgisPackMeta,\n\tid: POSTGIS_SPACE_ID,\n\tcontractSpace: postgisContractSpace,\n\ttypes: {\n\t\t...postgisPackMeta.types,\n\t\tcodecTypes: {\n\t\t\t...postgisPackMeta.types.codecTypes,\n\t\t\tcontrolPlaneHooks: { [POSTGIS_GEOMETRY_CODEC_ID]: geometryControlPlaneHooks }\n\t\t}\n\t},\n\tqueryOperations: () => postgisQueryOperations(),\n\tcreate: () => ({\n\t\tfamilyId: \"sql\",\n\t\ttargetId: \"postgres\"\n\t})\n};\n//#endregion\nexport { postgisExtensionDescriptor as default, postgisExtensionDescriptor };\n\n//# sourceMappingURL=control.mjs.map"],"mappings":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